![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
There are some idioms that make life easier, because you'll have less to type. They're often used in one-liners and throw-away scripts. But there's one that I like more and more, every time I use it. I'm using it in production scripts now, and I'm starting to wonder if that's a good idea. It's the cheap file slurp that uses the magical *ARGV and the fact that (@foo, $foo) = $bar will always set $foo to undef. Is this readable and maintainable enough, or do you think I should really stick to creating slurp routines? I know File::Slurp exists, but don't like using modules for what can be done with a simple sub or regex. (Or maybe I would use a module if there was one module with a bunch of subs that I often use. Maybe I should release a Juerd.pm... hmmm :) Do you think using the short slurping idiom in production code is a problem?
In reply to Cheap idioms by Juerd
|
|