Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by RMGir (Prior)
on Aug 04, 2003 at 20:28 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2025-07-12 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.