in reply to Re:{2} Getting impossible things right (behaviour of keys)
in thread Getting impossible things right (behaviour of keys)
Or you could exploit the fact that the regex looks for the leftmost matching string, and do something like:
my $pattern = join('|',(sort {$a cmp $b} keys %sufdata)); if ($name =~ s/($pattern)$/$sufdata{$1}/o) { print "Suffix $1 -> $name\n"; return; } print " no rule apply -> $name\n";
-Blake
In Section
Seekers of Perl Wisdom