in reply to <> oddity ?


reads from STDIN. Try this script:

while(<>) { print; }

This should behave similar to yours under your 3 scenarios.

$ ./ sample.txt whereas $ ./ <sample.txt or $ cat sample.txt | ./
UPDATE: I am stupid and should read "Programming Perl" again. Apologies for posting useless stuff. No idea what goes wrong with your code.