Gisle Aas wrote:

>Steve Hay <[EMAIL PROTECTED]> writes:
>
>  
>
>>I've created a script called sitecustomize.pl in c:\perl\site\lib (which 
>>is the path output by "perl -V:sitelibexp"), but the script doesn't seem 
>>to be getting run.  For example, if I have
>>
>>    print STDERR "Hello, world.\n";
>>
>>in the script, then I would expect to see that message output when I run 
>>"perl -e 1", but this doesn't happen.
>>
>>I walked through S_parse_body() in a debugger and the new chunk of code 
>>there is being run:
>>
>>#ifdef USE_SITECUSTOMIZE
>>    if (!minus_f) {
>>    if (!PL_preambleav)
>>        PL_preambleav = newAV();
>>    av_unshift(PL_preambleav, 1);
>>    (void)av_store(PL_preambleav, 0, Perl_newSVpvf(aTHX_ "BEGIN { do 
>>'%s/sitecustomize.pl' }", SITELIB_EXP));
>>    }
>>#endif
>>
>>The only strange thing that I noticed is that SITELIB_EXP, as returned 
>>by PerlEnvSiteLibPath(), was ";C:/perl/site/lib".  Is that leading 
>>semi-colon to be expected?
>>    
>>
>
>I did certainly not expect the leading ";" to be there.  I think that
>explains why it does not work on this platform.  I never tried to
>enable SITECUSTOMIZE on Win32 before.
>
Just about the only other place that SITELIB_EXP is used seems to be the 
incpush() call in perl.c (line 4241/3).  These calls both pass TRUE for 
the "usesep" flag, which causes the path to be broken on all 
PERLLIB_SEP's (";" on Win32), hence the leading ";" is removed when the 
path is added to @INC.

But the while() loop in S_incpush() would also suggest that SITELIB_EXP 
could potentially contain >1 directory, appropriately separated, so just 
removing a leading PERLLIB_SEP won't be good enough.

Perhaps the above chunk of code needs to do a bit more work to split up 
SITELIB_EXP on PERLLIB_SEP and then just use the first directory?

There is also the possibility that SITELIB_EXP could be NULL, which 
happens on Win32 for a perl still located in its build tree (because 
there is no site/lib sub-directory).

- Steve


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only.  If you have received this 
message in error or there are any problems, please notify the sender 
immediately.  The unauthorized use, disclosure, copying or alteration of this 
message is strictly forbidden.  Note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of Radan Computational Ltd.  The recipient(s) of this message should 
check it and any attached files for viruses: Radan Computational will accept no 
liability for any damage caused by any virus transmitted by this email.

Reply via email to