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

Re: Re: Re: Perl Idioms Explained - keys %{{map{$_=>1}@list}}

by RMGir (Prior)
on Aug 04, 2003 at 20:28 UTC ( #280791=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Perl Idioms Explained - keys %{{map{$_=>1}@list}}
in thread Perl Idioms Explained - keys %{{map{$_=>1}@list}}

Adding
'keys_map_undef' => sub { my @uniq = keys %{{ map {$_ => undef} @list +}}; },
to test the undef suggestion, it turns out to be 15-20% faster than using 1.

grep still wins, though.
--
Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://280791]
help
Chatterbox?
[stevieb]: je ne pas parles en Francais, but I prefer a vape, not a pipe ;)
[RonW]: shmem++ # too dumb to debug it

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-03-28 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (342 votes). Check out past polls.