Help for this page

Select Code to Download


  1. or download this
    sub find_in {
        my ($data_ref, $string) = @_;
        my $result = 'no result';
    ...
        $result = $$data_ref{$key};
        return $result;
    }
    
  2. or download this
    sub find_in {
        my ($data_ref, $string) = @_;
        return $$data_ref{ (grep /^$string$/i, keys %$data_ref)[0] || '' }
    + || 'no result';
    ...
    A: axxx
    B: bxxx
    Z: no result