Thanks so much for the quick response.  I
appreciate it.

Of course I am putting this cgi file on my website
domain and running it there, so in a way it is
running on Unix.

It is running that code, but whether it is working
or not is not clear to me.

At the beginning of the code @INC is:
/usr/local/lib/perl5/5.8.8/x86_64-linux/usr/local/lib/perl5/5.8.8/usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux/usr/local/lib/perl5/site_perl/5.8.8/usr/local/lib/perl5/site_perl.


When the code is finished @INC is almost identical:
/usr/local/lib/perl5/5.8.8/x86_64-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .

The space at the end is the only thing that is
different.  I am printing $path right after the
foreach for the first @INC printout.  I use
'print "\n\n\@INC = @INC\n";' for the 2nd printout
of @INC.

That @INC data is apparently from the website domain.

I get the digest version of this list, so it may
take me a while to respond to all posters.


Mike


On 1/27/2013 10:50 AM, Ken Slater wrote:

Hi,
I may be wrong, as I haven't used CGI or done much web programming,
but here is my take.
getpwuid seems like a unix call - are you sure this code is running on Windows.
This call is returning the home directory of the effective user of the script.
It the loops through each directory in the Perl include directories (@INC).
If a directory with the same name as a directory in the Perl include
path exists under the a perl subdirectory of the effective user's home
directory, it is added to the Perl include directories.  More
importantly, it is 'unshifted', so it is placed ahead of the usual
include directory that it matches. Thus the user's Perl subdirectory
will be used instead of the standard Perl installation library.
I do not think this would work on Windows, as the include directories
include the drive (C:,etc) in their name.
Not sure whether it would work on Unix (linux, etc), but that seems
like what it was designed for.
HTH,
Ken
HTH,
Ken



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to