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

Re^2: What does !$saw{$_}++ means

by Eimi Metamorphoumai (Deacon)
on Jan 26, 2005 at 13:36 UTC ( [id://425203]=note: print w/replies, xml ) Need Help??


in reply to Re: What does !$saw{$_}++ means
in thread What does !$saw{$_}++ means

I don't remember if it was quicker, but there also is the non-looped version:
undef %saw; @saw{@in} = (1) x @in; @out = keys %saw;
I haven't benchmarked it, but I've frequently heard it asserted that even faster is
undef %saw; @saw{@in} = (); @out = keys %saw;
That is, using undef as your values (so you don't need the increment or to create the list of ones).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-19 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found