Help for this page

Select Code to Download


  1. or download this
    my %myhash = (
      key1 => { map {$_ => 1} qw(abd bcd cde def efg) },
      key2 => { map {$_ => 1} qw(abd def} },
      key3 => { map {$_ => 1} qw(efg cde tgh) },
    );
    
  2. or download this
    my @winners = grep $myhash{$_}{efg}, keys %myhash;
    
  3. or download this
    my %inside_out;
    for my $first_key (keys %myhash) {
    ...
      print "$second_key => ",
        join(", ", sort keys %{$inside_out{$second_key}}), "\n";
    }