Re: Code suggestion for LIBWWW_PERL env var
Roy T. Fielding (fielding@avron.ICS.UCI.EDU)
Mon, 09 Jan 1995 12:30:33 -0800
> I suggest this alternate implementation in places like the start of script
> get (POST & HEAD..):
>
> if($libloc = $ENV{'LIBWWW_PERL'})
> {
> foreach(split(/:/,$libloc)) { unshift(@INC, $_); }
> }
>
> This allows something like:
>
> setenv LIBWWW_PERL /usr/local/gnu/lib:/usr/local/users/lib:/home/rlv/lib
>
> Your current code would lead one to believe that I could do this:
>
> setenv LIBWWW_PERL "/usr/local/gnu/lib /usr/local/users/lib /home/rlv/lib"
>
> but the entire string is unshifted into @INC as a single string and
> we loose the multiple paths.
>
> The new scheme works like the usual PATH stuff.
Ummmmm, but it's not supposed to work like the usual PATH stuff.
Note that in wwwmime.pl it is used to find the default mime.types file:
$libloc = ($ENV{'LIBWWW_PERL'} || '.');
&load_mimetypes("$libloc/mime.types");
I should probably come up with a better way to do this anyway, but it
seemed so convenient at the time.
> I hit this because my sys admin hadn't installed the sys/socket.ph
> correctly and
> I had to get the scripts to see my own version in my home directory.
Why not just create a "sys" directory under your libwww-perl directory?
Perl should pick up the first one on the @INC path.
You can also use the $PERLLIB variable (a colon-separated value like PATH)
to initialize the @INC to your own default.
......Roy Fielding ICS Grad Student, University of California, Irvine USA
<fielding@ics.uci.edu>
<URL:http://www.ics.uci.edu/dir/grad/Software/fielding>