Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: Hash slices ?

by davorg (Chancellor)
on Dec 01, 2000 at 17:53 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://44343]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found