Help for this page

Select Code to Download


  1. or download this
    %hash = (a   => 1,
             ab  => 1,
             abc => 1,
             ac  => 1);
    $key = 'ab';
    
  2. or download this
    my @list_of_keys = sort grep /(^$search|$search$)/o, keys %hash;
    
  3. or download this
    my @list_of_keys = sort grep { substr($_, 0, length($search)) eq $sear
    +ch || 
                                   substr($_, -length($search)) eq $search
    + }, 
                            keys %hash;