It's a little nasty due to matching more times than I'd like, but it works. :)while (m/\[\[\w+\]\]/) { my $oldpos = pos; m/\[\[(\w+)\]\]/; my $expansion = $helper->($1); pos = $oldpos; s/[[$1]]/$expansion/; }
In reply to Re: Functions in substitutions (s///) and Perl 5.8.
by teichman
in thread Functions in substitutions (s///) and Perl 5.8.
by v_thunder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |