develooper Front page | perl.perl5.porters | Postings from August 2013

Re: test.pl runperl() exit oddity

Thread Previous
From:
Nicholas Clark
Date:
August 8, 2013 08:04
Subject:
Re: test.pl runperl() exit oddity
Message ID:
20130808080445.GG3729@plum.flirble.org
On Wed, Aug 07, 2013 at 02:05:45PM -0400, George Greer wrote:
> On Wed, 7 Aug 2013, Nicholas Clark wrote:

> > Does
> >
> >    perl <nul.txt -e1
> >
> > work too?
> >
> > (ie it's still compatible with MS/DOS and earlier)
> 
> Appears so:
> 
> perl <nul.txt -e1 & echo %ERRORLEVEL%
> 0

Ho ho ho. I'm sure there is potential for mischief there.

But I guess that this also means that in our portable filename rules we
ought to be mentioning the four (four?) CP/M device special files,
AUX, CON, NUL and PRN, and forbidding adding any filename to the repository
that matches /(?:AUX|CON|NUL|PRN)(?:\z|\.)/

And, if I read it correctly, the MS-DOS names also don't need colons, so
LPT1.txt, COM2.c etc are not what any non-Redmond OS would expect.

> > Is it that /dev/null works from within perl, but not on the command line?
> 
> Special-cased in win32/win32.c:
> 
>      if (stricmp(filename, "/dev/null")==0)
>          filename = "NUL";

Thanks. I missed that. I missed it three! times. :-(

> > If so, the fix would seem to be to change the new code to
> >
> >        $runperl = $runperl . ($is_mswin ? ' <nul' : ' </dev/null');
> >
> > Does this make t/op/fork.t test 16 pass again on Win32?
> > That now seems to be failing, and I don't know why.
> 
> That I can't check at $WORK.

As you have probably already read:

Good news: Steve Hay captured a failure
Bad news: Attempt to free unreferenced scalar: SV 0x2d984c, Perl interpreter: 0x2d236c

Nicholas Clark

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About