foreach my $key (keys %subs) { warn "checking key: $key\n"; if ($html =~ s/$key/$subs{$key}->()/eg) { warn $html; last; } }
So that you leave the loop once you've made a substitution.
In reply to Re: Global replace issue
by FunkyMonk
in thread Global replace issue
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |