On Sun, 27 Jan 2013 10:30:38 -0600
Mike Flannigan <[email protected]> wrote:
>
> I have written some CGI applications that start
> with this code:
>
>
> BEGIN {
> my $homedir = ( getpwuid($>) )[7];
> my @user_include;
> foreach my $path (@INC) {
> if ( -d $homedir . '/perl' . $path ) {
> push @user_include, $homedir . '/perl' . $path;
> }
> }
> unshift @INC, @user_include;
> }
>
>
> I have failed to document exactly what this section
> is doing and would like to correct that. Am I correct
> when I say that this code includes all the directories
> where Perl is located (C:/Perl in my case) in @INC, so
> there is little chance of not finding a module I have
> installed and am calling in this CGI script?
It's better to keep local modules under the same directory as the
script.
use FindBin qw( $RealBin );
use lib $RealBin;
See:
perldoc FindBin
perldoc lib
--
Don't stop where the ink does.
Shawn
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/