in reply to Re^3: File Reading and Closing confusion
in thread File Reading and Closing confusion
$ perl -e 'print "with_ending\nno_ending"' > a.txt $ perl -MData::Dumper open(FH, "<", "a.txt") or die $!; my $line1 = <FH>; my $line2 = <FH>; my $line3 = <FH>; close FH; $Data::Dumper::Useqq = 1; print Dumper [$line1, $line2, $line3]; __END__ $VAR1 = [ "with_ending\n", "no_end", undef ];
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: File Reading and Closing confusion
by shmem (Chancellor) on Aug 09, 2010 at 09:30 UTC | |
by repellent (Priest) on Aug 09, 2010 at 15:37 UTC |