note
gone2015
<p>How about:</p><code>
$$text_ref =~ s|(?<="http://)(.*?)(?=["/])|$fixers{$1} ? $fixers{$1} : $1|ge ;
</code>
<p>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.<p>
<p>the more complicated:<code>
my $what = join('|', map(quotemeta, keys %fixers)) ;
$$text_ref =~ s!(?<="http://)($what)(?=["/])!$fixers{$1}!ge ;
</code>also does just the one scan and hits only the fixers.</p>
718936
718936