Good general advice... in this case, however, every match will succeed -- the test is required to spot the key matching itself. For the paranoid one could write:
but the next unless is redundant.foreach my $k (@k) { next unless $s =~ m/(.)$k(.)/ ; next if (($1 eq "\0") && ($2 eq "\0")) ; delete $h{$k} ; } ;
In reply to Re^3: hash substrings
by gone2015
in thread hash substrings
by perlcat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |