Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Do you know where your variables are?
 
PerlMonks  

Idiom: hashes as sets

by w-ber (Hermit)
on Jul 02, 2008 at 18:21 UTC ( #695171=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      my %set = ();
      my @new_items = ...;
      @set{@new_items} = (1) x @new_items;
    
  2. or download this
      delete @set{@other_items};
    
  3. or download this
      # Difference.
      sub difference {
    ...
        @symm{@set1, @set2} = (1) x (@set1 + @set2);
        \%symm;
      }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-04-20 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls