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