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

Re: Re: Re: Hash slices ?

by davorg (Chancellor)
on Dec 01, 2000 at 17:53 UTC ( #44343=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = (one => 1, two => 2, three => 3);
    my @keys = qw(four five six);
    my @slice = @hash{@keys};
    
  2. or download this
    if (grep { exists %hash{$_} } @keys) {
      print "yep\n";
    } else {
      print "nope\n";
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2016-02-07 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (254 votes), past polls