Help for this page

Select Code to Download


  1. or download this
    # destructive
    while( my $k = each %hash ) {
    ...
    while( my( $k, $v ) = each %hash ) {
        $hash2{ $k } = $v if $k =~ /\d+_\d+/;
    }
    
  2. or download this
    # destructive
    /\d+_\d+/ or delete $hash{ $_ } while local $_ = each %hash;
    ...
    # nondestructive
    my %hash2;
    /\d+_\d+/ and $hash2{ $_ } = $a while local( $_, $a ) = each %hash;