Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: to select unique characters

by johngg (Canon)
on Feb 13, 2008 at 10:42 UTC ( #667752=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %seen;
    my @uniq = grep { ! $seen{$_} ++ } @arr;
    
  2. or download this
    use strict;
    use warnings;
    ...
                  return keys %seen;
              },
       });
    
  3. or download this
               Rate  useGrep useSlice
    useGrep  13.0/s       --     -63%
    useSlice 35.2/s     172%       --
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-02-27 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?