Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 meditating upon the Monastery: (7)
As of 2014-12-26 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls