in reply to How can I increment a var in a substitution?
the e modifier means evaluate right side of substitution as perl code... so you need /'<<TOKEN_'.$n++.'>>'/ to make it into perl code that makes the string you want to substitute... you could also do...
which is a little trick to put code into an interpolated string$html_file_slurped_to_a_scalar =~ s/<img .*?>/«TOKEN_${\($n++)}»/gis;
- Ant
- Some of my best work - Fish Dinner
In Section
Seekers of Perl Wisdom