Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Idiom: hashes as sets

by kyle (Abbot)
on Jul 03, 2008 at 16:14 UTC ( #695384=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub uniq (@) {
        my %h;
        map { $h{$_}++ == 0 ? $_ : () } @_;
    }
    
  2. or download this
    sub bad_uniq {
        my %h;
        @h{@in} = ();
        return keys %h;
    }
    
  3. or download this
    use List::MoreUtils 'uniq';
    use Data::Dumper;
    ...
    @from_keys = ( 
                   'ARRAY(0x8153c28)'
                 );
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-10-02 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (56 votes), past polls