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};