diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-14 05:51:56 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-02-14 05:51:56 +0000 |
commit | fbad3eb55c1f8c84d1dfd0e484ecddeffc891e79 (patch) | |
tree | f3886be033e03113de9177f18cdf413345741e1c /t/io | |
parent | 428f79ef10ad4e14667125f22397bceac3e2c65e (diff) | |
download | perl-fbad3eb55c1f8c84d1dfd0e484ecddeffc891e79.tar.gz |
slurping an empty file should return '' rather than undef, with
commensurate effects on ARGV processing
p4raw-id: //depot/perl@2910
Diffstat (limited to 't/io')
-rwxr-xr-x | t/io/argv.t | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/t/io/argv.t b/t/io/argv.t index d99865e142..cb2ffb346e 100755 --- a/t/io/argv.t +++ b/t/io/argv.t @@ -1,10 +1,8 @@ #!./perl -# $RCSfile: argv.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:25 $ +print "1..6\n"; -print "1..5\n"; - -open(try, '>Io.argv.tmp') || (die "Can't open temp file."); +open(try, '>Io.argv.tmp') || (die "Can't open temp file: $!"); print try "a line\n"; close try; @@ -45,4 +43,17 @@ if ($y eq "1a line\n2a line\n3a line\n") else {print "not ok 5\n";} -unlink 'Io.argv.tmp'; +open(try, '>Io.argv.tmp') or die "Can't open temp file: $!"; +close try; +@ARGV = 'Io.argv.tmp'; +$^I = ''; +$/ = undef; +while (<>) { + s/^/ok 6\n/; + print; +} +open(try, '<Io.argv.tmp') or die "Can't open temp file: $!"; +print while <try>; +close try; + +END { unlink 'Io.argv.tmp' } |