Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Cheap idioms

by Aristotle (Chancellor)
on Oct 13, 2002 at 11:13 UTC ( #204885=note: print w/replies, xml ) Need Help??


in reply to Cheap idioms

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://204885]
help
Chatterbox?
[davies]: I've just "approved" using syscalls in perl through inline c for at least the third time, but it still appears to me as unapproved. Is this just me?
[LanX]: erix: other side of the pond
[LanX]: davies: same problem
[Corion]: It had been approved as a Perl Monks Discussion. It should now be approvable into SoPW
[choroba]: Approved
[LanX]: hmm aproval doesn't stick after move? Or was it a race condition
[Corion]: I think you need at least one reload after moving before you can approve in the correct section
[GotToBTru]: it was approved . but isnt now

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-01-16 15:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.