|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Comment on |
| ( #3333=superdoc: print w/ replies, xml ) | Need Help?? |
|
I like the idiom. It took me a moment to grok what was happening with @ARGV, but now I've seen it I won't need to think again. However I'd still tack a comment on it (just a # slurp). The sub on the other hand is needlessly verbose. Why not take the middle road:
sub slurp { local (@ARGV, $/) = shift; <> }
Now the sub's name is the comment, and its calls are self documenting. Putting this in an Idiom::Common among with similar snippets would be nice. :) Makeshifts last the longest. In reply to Re: Cheap idioms
by Aristotle
|
|