develooper Front page | perl.perl5.porters | Postings from November 2003

Re: bug or a feature?

Thread Previous | Thread Next
Nicholas Clark
November 21, 2003 14:53
Re: bug or a feature?
Message ID:
On Fri, Nov 21, 2003 at 09:16:26PM +0000, Nick Ing-Simmons wrote:
> Torsten Foertsch <> writes:
> >
> >
> >In both cases sv_gets() at line 1576 returns false (EOF). But with $/="\n" it 
> >enters the if-block at line 1579 goes through lines 1596 and 1597 and returns 
> >in line 1603. With $/=undef the if-block at line 1579 is not entered.
> >
> >BTW, what does RsSNARF (or simply snarf) mean? I have looked it up at 
> > with no result.
> I am not sure what "snarf" means, but RsSNARF means: $/ is undef, read
> entire file as one "line".
> I think there is a "feature" that the "whole file" means each-file
> in the case of *ARGV aka <>.

Yes, that's a feature. But what we seem to agree is a bug is the change
from this behaviour:

$ perl5.00405 -we 'undef $/;open F, "/" and defined(scalar <F>) and print "ok\n"; print "$!\n"'
Is a directory

to that behaviour:

$ perl5.00503 -we 'undef $/;open F, "/" and defined(scalar <F>) and print "ok\n"; print "$!\n"'
Is a directory

which Andreas has identified as caused by this patch:

which I vaguely remember reading about at the time.

And if we agree that this change is a regression, then someone needs to
write a test case, and someone (else) a fix.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About