in reply to Idle search for a file-read idiom
Is there something more succinct and/or less klugey?
In terms of straight Perl, I think you've pretty much got it. The "@ARGV hack", as you call it, is a standard slurp idiom. I agree that it's not pretty, but it works most of the time. When it fails, the standard open constructs aren't that bad.
But if you really want to do some slick IO with a small amount of work, take a look at IO::All. There are so many cool things it can do, with such a small amount of effort, that I'm not even going to try to summarize them. Just check it out. :-)
|
|---|