Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-07-02 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (28 votes), past polls