in reply to <> oddity ?
while(<>)
reads from STDIN. Try this script:
while(<>) { print; }
This should behave similar to yours under your 3 scenarios.
$ ./weird.pl sample.txt whereas $ ./weird.pl <sample.txt or $ cat sample.txt | ./weird.pl
|
---|
In Section
Seekers of Perl Wisdom