note
Krambambuli
As expected... hmm.
Define a sample.txt like
<code>
1
2
3
</code>
And then run
$ test.pl sample.txt<br><br>
where test.pl is
<code>
#!/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 = <>;
</code>
Why would this program then NOT wait for any further input via STDIN ?
1025665
1025680