Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Ouch! Each! Reentrant it is not

by Thilosophy (Curate)
on Jul 15, 2005 at 03:01 UTC ( #475112=note: print w/ replies, xml ) Need Help??


in reply to Re: Ouch! Each! Reentrant it is not
in thread Ouch! Each! Reentrant it is not

You can avoid the scalar op and a useless variable by just calling keys in scalar context

Taking it one step further, it seems you can also call it in void context (which is maybe more efficient):

if ($val == 2 ){ keys %hash; return "The key for 2 is $key\n"; }


Comment on Re^2: Ouch! Each! Reentrant it is not
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://475112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-11-20 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (103 votes), past polls