in reply to Idle search for a file-read idiom

Am I missing something? I'd suggest:
while (<>) { frobnicate($_); }
Run it with "$0 foobar.txt"

-Scott

Replies are listed 'Best First'.
Re^2: Idle search for a file-read idiom
by polettix (Vicar) on Apr 22, 2005 at 16:26 UTC
    You're assuming that @ARGV contains only the file name. This solution is what tlm suggests to use as an alternative to his quick hack, but he has to set @ARGV first.

    Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')

    Don't fool yourself.