I'm assuming you don't want to modify the original strings. I'm also assuming that your words are divided on non-letter boundaries.my $newstring = munge_string( 'one_two_three', '312' ); print $newstring; sub munge_string { $_ = $_[1]; split /[^a-zA-Z]+/, $_[0]; s/(\d)/$_[$1-1]/g; return $_; }
In reply to Re: Double interpolation of captured substrings
by TedPride
in thread Double interpolation of captured substrings
by bobf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |