I don't see anything in the substitution chapter that directly uses one of my favorite techniques -- calling subs on the rhs of a substitution. It may be obvious, if you think about it, but it's worth discussion. Everything (and Slash) handle links in textfields with something like this:
$text =~ s/\[([^\]]+)\]/parseLink($1)/eg;
sub parseLink {
my $link = shift;
my ($type, $title);
($type, $link, $title) = $link =~ m!(.+)://(.+)|(.+)!;
$type ||= '';
$title ||= $link;
return makeLink($link, $title, $type);
}
Somewhat hastily reconstructed out of memory. It's a little more optimized in the code, I believe. It's also a very nice way to handle more complex transformations.