Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

(tye)Re: Partial extractions on hashes

by tye (Sage)
on May 12, 2001 at 01:57 UTC ( [id://79850]=note: print w/replies, xml ) Need Help??


in reply to Re: Partial extractions on hashes
in thread Partial extractions on hashes

You can shorten that quite a bit:

%hash = ('k1' => 'abc', 'k2' => 'def', 'k3' => '123abcdef456'); @array = map $hash{$_} =~ /abc/ ? $_ : (), keys %hash; foreach (@array) { print "$_: $hash{$_}\n"; }

        - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found