http://qs321.pair.com?node_id=1025683


in reply to Re: <> oddity ?
in thread <> oddity ?

As expected... hmm. Define a sample.txt like
1 2 3
And then run $ test.pl sample.txt

where test.pl is
#!/usr/bin/perl use strict; use warnings; my $i = 0; while (<>) { print $_; last if ++$i >= 2; } my $line; print "My extra line: $line" while $line = <>;
Why would this program then NOT wait for any further input via STDIN ?