Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
There's more than one way to do things
 
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 exploiting the Monastery: (7)
As of 2014-04-18 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (464 votes), past polls