in reply to How else can I read from a file without using a while loop, testing for the EOF?

Oh, but the looping and checking for EOF is the trivial part. I hate the open()ing, checking for [and properly reporting] failure, and close()ing part.

my @lines; { local( @ARGV )= $filename; @lines= <>; }

    - tye

Originally posted as a Categorized Answer.

  • Comment on Re: How else can I read from a file without using a while loop, testing for the EOF?
  • Download Code