At 7:04 PM -0500 11/22/05, John E. Malmberg wrote:
>Rafael Garcia-Suarez wrote:
>>On 11/22/05, John E. Malmberg <[EMAIL PROTECTED]> wrote:
>>
>>>The file ext/List/Util/t/p_tainted.t is assuming a UNIX format pathname
>>>is returned by __FILE__.
>>
>>__FILE__ is initially set from PL_origfilename in perl.c. It's saved
>>as CopFILE in each cop (control op) in the optree (grep for
>>CopFILE_set for points where it's set.) In toke.c it can be modified
>>when parsing #line directives (like in C, basically). Finally, the
>>function pp_require() in pp_ctl.c can set it to the file name it
>>opens, corresponding to a .pm file usually.
>
>Something is converting the name in __FILE__ to VMS syntax when I run the 
>script.

Actually it's probably just reporting it in whatever syntax is being passed to 
it:

$ perl ./foo.tmp
./foo.tmp
$ perl sys$disk:[]foo.tmp
sys$disk:[]foo.tmp
$ type foo.tmp
print __FILE__;

>
>
>>That said, your fix looks strange to me. The "./" is here to ensure
>>the script looks for tainted.t in the current directory.  As
>>p_tainted.t is run with the -T switch, the current directory is not
>>included in @INC, so do() shouldn't look for tainted.t in the current
>>directory at all, and then fail. And that's probably what's happening,
>>since in this case p_tainted.t produces no output at all...
>
>Then I am still confused.
>
>__FILE__ is returning: '[-.ext.list.util.t]p_tainted.t'
>
>Now the UNIX equivalent to that would be: ../ext/List/Util/t/p_tainted.t

when running in the Perl core build environment, but plain old
p_tainted.t when built as an independent CPAN module.  Prepending the
'./' is probably only necessary in the standalone module build.  If
concatenating filenames is really necessary, then
File::Spec->catdir() is going to be the only portable way of doing it.



-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to