Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: grep for hash?

by LanX (Saint)
on Jul 07, 2009 at 14:54 UTC ( [id://777896]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %hash_2= map { /regex/ ? ( $_ , $hash_1{$_} ) 
                           : () 
               } keys %hash_1;
    
  2. or download this
    my @keys = grep { /regex/ } keys %hash_1;
    @hash_2{@keys} = @hash_1{@keys};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-23 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found