It's hard to tell what a good solution would be without knowing more about the real problem. I can think of two trivial solutions.
Use reverse to process the items in the opposite order.
my $x = "<0>"; for (reverse '<1>', '<2>', '<3>') { $x =~ s/(<0>)/${1}${_}/; }
Just do one replace.
my $x = "<0>"; $x =~ s/(<0>)/$1 . join('', '<1>', '<2>', '<3>')/e;
In reply to Re: How to start regexp from a X position
by ikegami
in thread How to start regexp from a X position
by pkt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |