in reply to Functions in substitutions (s///) and Perl 5.8.
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/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Functions in substitutions (s///) and Perl 5.8.
by teichman (Novice) on Oct 24, 2002 at 16:44 UTC |