Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: to select unique characters

by johngg (Canon)
on Feb 13, 2008 at 10:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://667752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found