The solution is to copy the captures earlier. One way:
if ( my ($new1, $new2, $new3) = $string =~ /(p1)(p2)(p3)/ ) { $new1 =~ s/this/that/; $new2 =~ s/this2/that2/; $new3 =~ s/this3/that3/; ... }
Bonus: No global vars!
In reply to Re: modifying en passant
by ikegami
in thread modifying en passant
by lcschreier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |