Help for this page

Select Code to Download


  1. or download this
    my %hash = (one => 1, two => 2, three => 3);
    my @keys = qw(four five six);
    my @slice = @hash{@keys};
    
  2. or download this
    if (grep { exists %hash{$_} } @keys) {
      print "yep\n";
    } else {
      print "nope\n";
    }