##
while (<>)
{
print "$ARGV: $.: $_";
}
continue
{
if ( eof )
{
close ARGV;
last;
}
}
print "\nnext While\n\n";
while (<>)
{
print "$ARGV: $.: $_";
}
continue
{
if ( eof )
{
close ARGV;
last;
}
}
print "\nDone\n";
####
X:\>while_eof file1 file2
file1: 1: file1
file1: 2: line2
file1: 3: line3
next While
file2: 1: file2
file2: 2: line2
file2: 3: line3
Done