a_ you should preload modules into mod_perl already to take advantage of shared memory

b_ you can automate listing the files using File::Find and some sprintf magic

====
        my      @perl_files ;
        use File::Find;
        find(\&wanted, ( /paths/to/modules ) );
    sub wanted
    {
        my %pathname = map { $_ , 1 } split '/' , $File::Find::name;
                
                # kill the subversion files
        return if ( $pathname{'.svn'} );

                # only pm
                return unless ( substr( $_ , -5 ) eq '.pm' );

                push @ perl_files , $File::Find::name;
    }
===




On Feb 22, 2006, at 9:10 PM, <[EMAIL PROTECTED]> wrote:

Looks like what I needed (if works) but with a lot of editting: use Module1,
use Module2, ..., use ModuleN.


Thanks.

Harry




----- Original Message -----
From: "Jonathan Vanasco" <[EMAIL PROTECTED]>
To: "Harry Zhu" <[EMAIL PROTECTED]>
Cc: "mod_perl List" <modperl@perl.apache.org>
Sent: Wednesday, February 22, 2006 3:53 PM
Subject: Re: find all uninitialized variables?


if you
use strict ;
use warnings;

any module that you load w/an uninitialized variable will print an error

what i do is as follows:

use warnings & strict in $APP_DIR/etc/startup.pl
include all my modules in $APP_DIR/etc/startup.pl

tail -f $APP_DIR/logs/error.log

sudo /usr/local/apache2/bin/apachectl restart

that will try and include all the modules i listed in startup.pl

if there's an uninitialized value, apache won't start up, and it will
tell me the line.
i fix that, and try to start apache again

if you preload, you don't have  to run through the pages - but it
will crash on the first variable


On Feb 22, 2006, at 6:37 PM, Harry Zhu wrote:

Say I have a file directory with hundreds of modules, I want to
know if there is a tool I can scan and identify the uninitalized
variables in all the files once (or through a loop) without
actually running through all the pages.

Harry





Reply via email to