NAME

Meta::Baseline::Lang::Perl - doing Perl specific stuff in the baseline.

COPYRIGHT

Copyright (C) 2001 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

MANIFEST: Perl.pm PROJECT: meta

SYNOPSIS

package foo; use Meta::Baseline::Lang::Perl qw(); my($resu)=Meta::Baseline::Lang::Perl::env();

DESCRIPTION

This package contains stuff specific to Perl in the baseline: 0. produce code to set Perl specific vars in the baseline. 1. check Perl files for correct Perl syntax in the baseline. etc...

EXPORTS

env() c2chec($) check($$$) check_use($$$$$$) check_lint($$$$$$) check_doc($$$$$$) check_misc($$$$$$) check_mods($$$$$$) check_fl($$$$$$) check_pods($$$$$$) module_to_file($) module_to_search_file($) file_to_module($) c2deps($) get_use($$$) get_pod($) get_pods($) check_list($$$) check_list_pl($$$) check_list_pm($$$) run($) man($) runline($$$$$) docify($) c2objs($) c2manx($) c2nrfx($) c2html($) c2late($) c2txtx($) my_file($$) source_file($$) create_file($$) pod2code($) fix_history($$) fix_license($$) fix_author($$)

FUNCTION DOCUMENTATION

env()

This routie returns a hash of environment variables which are essential for running Perl scripts.

c2chec($)

This routine checks a file for the following things: 0. check the first line (#!/usr/bin/env perl). 1. check every use actually used. 2. check name of package with each part with capital. 3. check use strict and diagnostics and exporter and loader. 4. check documentation (check out the podchecker executable). 5. check syntax by running the interpreter in syntax check mode. 6. What about perl cc ? what does it do ? 7. check for bad strings ";\n" "\t " two spaces etc..

check($$$)

This method does the actual checking and returns the result.

check_use($$$$$$)

This is my own module to check for "use module" which is not really in use.

check_lint($$$$$$)

This one will run the B::Lint module and make sure that it comes up empty. This one needs to be changed to catch the output of the command and process it.

check_doc($$$$$$)

This method will check the documentation of an object. This means that every method is documented and all the headers are there. Currently it does nothing.

check_misc($$$$$$)

This will check miscelleneous text features that we dont like in the baseline.

check_mods($$$$$$)

This will check modules which must be used in different file types.

check_fl($$$$$$)

This will check the first line of a perl script or module.

check_pods($$$$$$)

This check will check the content of the pods.

module_to_file($)

This will translate a module name to a baseline relative file name.

module_to_search_file($)

This will translate a module name to a module file to search for (without the perl/lib prefix...

file_to_module($)

This will translate a file name to a module name.

c2deps($)

This will generate a dep file from a perl file.

get_use($$$)

This method gets a perl file and returns the list of modules this file uses in the order it is using them. The module can be made to bring external and internal uses or either one.

get_pod($)

This method returns all pod directives in a text.

get_pods($)

This method returns all pod directives in a text in a hash.

check_list($$$)

Check the syntax of a number of perl files. Inputs are the list of files, be verbose or not and die or not on error.

check_list_pl($$$)

Routine that calls check_list for all items

check_list_pm($$$)

Routine that calls check_list for all items

run($)

Routine to run the perl script it receives as input.

man($)

Routine to show a manual page of a perl module (the parameter).

runline($$$$$)

This routine changes the runline in all perl scripts in the baseline. This script receives: 0. demo - whether to actually change or just demo. 1. verb - whether to be verbose or not. 2. line - which line to plant in all the perl scripts. 3. chec - whether to do a check that the current runline in the scripts is something. 4. cstr - what is the check string to check against.

docify($)

This method is here because I needed it for the html conversion but eventualy didnt use it. Try to use it in the future.

c2objs($)

This methos will compile perl to bytecode. This method returns an error code. Currently this does nothing.

c2manx($)

This method will generate manual pages from perl source files. This method returns an error code.

c2nrfx($)

This method will convert perl source files into nroff output.

c2html($)

This method will convert perl source files into html documentation. This method returns an error code.

c2late($)

This method will convert perl source files into latex documentation. This method returns an error code.

c2txtx($)

This method will convert perl source files into text documentation. This method returns an error code.

my_file($$)

This method will return true if the file received should be handled by this module.

source_file($$)

This method will return true if the file received is a source of this module.

create_file($$)

This method will create a file template.

pod2code($)

This method receives the text of a program and returns the code part of the pod.

fix_history($$)

This will fix the =head1 HISTORY pod tag to reflect aegis history.

fix_license($$)

This will fix the LICENSE tag.

fix_author($$)

This will fix the AUTHOR tag.

BUGS

None.

AUTHOR

Mark Veltzer <mark2776@yahoo.com>

HISTORY

start of revision info 1 Mon Jan 1 16:38:12 2001 MV initial code brought in 2 Sat Jan 6 02:40:51 2001 MV Another change 3 Sat Jan 6 11:39:39 2001 MV make quality checks on perl code 4 Sat Jan 6 17:14:09 2001 MV more perl checks 5 Sun Jan 7 18:17:29 2001 MV make Meta::Utils::Opts object oriented 6 Tue Jan 9 08:56:56 2001 MV tests for Opts in every .pl 7 Tue Jan 9 17:00:22 2001 MV fix up perl checks 8 Tue Jan 9 18:15:19 2001 MV check that all uses have qw 8 Tue Jan 9 19:29:31 2001 MV fix todo items look in pod documentation 9 Wed Jan 10 12:05:55 2001 MV more on tests/more checks to perl 10 Wed Jan 10 18:31:05 2001 MV more perl code quality 11 Thu Jan 11 17:46:02 2001 MV silense all tests 12 Thu Jan 11 19:25:00 2001 MV more quality testing 13 Thu Jan 11 22:31:19 2001 MV more perl code quality 14 Fri Jan 12 09:25:33 2001 MV more perl quality 15 Sun Jan 14 02:26:10 2001 MV introduce docbook into the baseline 16 Sun Jan 14 05:25:04 2001 MV fix up perl cooking a lot 16 Thu Jan 18 15:59:13 2001 MV correct die usage 17 Thu Jan 18 19:33:43 2001 MV fix expect.pl test 18 Fri Jan 19 12:38:57 2001 MV more organization 19 Sat Jan 27 19:56:28 2001 MV perl quality change 20 Sun Jan 28 02:34:56 2001 MV perl code quality 21 Sun Jan 28 13:51:26 2001 MV more perl quality 22 Mon Jan 29 20:54:18 2001 MV chess and code quality 23 Tue Jan 30 03:03:17 2001 MV more perl quality 24 Wed Jan 31 15:28:22 2001 MV get basic Simul up and running 25 Sat Feb 3 03:39:36 2001 MV make all papers papers 26 Sat Feb 3 23:41:08 2001 MV perl documentation 27 Mon Feb 5 03:21:02 2001 MV more perl quality 28 Tue Feb 6 01:04:52 2001 MV perl qulity code 29 Tue Feb 6 07:02:13 2001 MV more perl code quality 30 Tue Feb 6 08:47:46 2001 MV more perl quality 31 Tue Feb 6 22:19:51 2001 MV revision change 32 Fri Feb 9 09:22:45 2001 MV revision for perl files and better sanity checks end of revision info

SEE ALSO

Nothing.

TODO

-get a better version of the Pod::Text package (the current one sucks). take care of the return code to the os (it is always success now).

-remove the output file if any error occurs in the process.

-put all the conversion stuff in the perl.pm module and not here and just call it from here.

-use the B:: compiler to do what we do here and not my stupid script.

-nroff conversion currently does nothing. How do you convert pod to nroff ?

-the option causes the cache to be flushed before every activation. We use this module file by file so there should be no cache and so I dont realy think this is neccessary so I dropped it.

-On the other hand we do need to remove the cache once the pod2html is over and that is tougher since the Pod::Html module has no provisioning for that. We do this by hacking a bit and removing the cache ourselves by accessing the modules private variables which are the names of the cache files and removing them ourselves. I contancted Tom Christiasen about it and asked him for the feature.

-Another remark: The result of pod2html is undocumented but it seems that it does not return anything (I looked in the code). I asked for this feature too from Tom but its still not in. In the meantime this utility will always succeed...:)

-byte compilation currently does nothing. Do it.

-the docify routine here is also something from the html conversion.

-maybe a better check is not to activate the perl compiler but rather to do an eval on the file ?

-What about the location of this module ? are there so much location specific stuff to justify it being here ? Why is it in Meta::Baseline ? maybe it should be in Meta::Utils::Perl ?

-can we activate a perl compiler and precompile all the perl modules ?.

-c2html always returns 1 because the error code from the module seems to be no good. How can I take care of that ?

-pod2latex is used in a bad way. Why cant it just produce the output in the place I want it to ? change it...

-stopped using -MO=lint,all and -w in the lint processing because of errors- bring that back.