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

Localizing @ARGV prevents magic <> behavior later

Thread Next
From:
demerphq
Date:
May 25, 2013 17:02
Subject:
Localizing @ARGV prevents magic <> behavior later
Message ID:
CANgJU+WBAVi+vL3cNo1C6SWoRXKdi8+pcSNKSDEJTU2N+MCnzw@mail.gmail.com
Would I be right that this does not die is a bug?

It has failed for as long as Porting/bisect.pl can test.

$ seq 3 | perl bug.pl
my $s= do { local (@ARGV,$/)= ($0); <> };
print $s;
while (<>) { die $_ };
print "did not die\n";
__END__
did not die


$ ../perl/Porting/bisect.pl --target=miniperl -Dcc=ccache\ gcc
-Dld=gcc -- ../bug.sh
[....]
Can't find a suitable start revision to default to.
Tried perl-5.002 perl-5.003 perl-5.004 perl-5.005 perl-5.6.0
perl-5.8.0 v5.10.0 v5.12.0 v5.14.0 v5.16.0 v5.18.0 at
../perl/Porting/bisect.pl line 214.
That took 364 seconds

$ cat ../bug.sh
#!/bin/bash
seq 3 | ./miniperl ../bug.pl
$ cat ../bug.pl
my $s= do { local (@ARGV,$/)= ($0); <> };
print $s;
while (<>) { exit 0 }
exit 1;
__END__


--
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Next


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