Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 taking refuge in the Monastery: (2)
As of 2024-04-24 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found