in reply to Replace after match in regex (key value subsitution)
How about:
$$text_ref =~ s|(?<="http://)(.*?)(?=["/])|$fixers{$1} ? $fixers{$1} + : $1|ge ;
which does one scan of the input. This may be an advantage if you have a lot of fixers. But, if there are a lot of things that match, but don't require fixing, doesn't work so well.
the more complicated:
also does just the one scan and hits only the fixers.my $what = join('|', map(quotemeta, keys %fixers)) ; $$text_ref =~ s!(?<="http://)($what)(?=["/])!$fixers{$1}!ge ;
In Section
Seekers of Perl Wisdom