Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by greenFox (Vicar)
on Jul 15, 2005 at 03:04 UTC ( #475113=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:

I'd want to see that documented in the code or someone will get bitten!

keys %hash; # reset each to beginning of hash return "The key for 2 is $key\n" if $val == 2;

--
Murray Barton
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2020-05-25 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (146 votes). Check out past polls.

    Notices?