Peter Davis writes:Nope, my error. $1 gets clobbered by the second replacement. So you'd
> That was the first thing I tried, and Perl complained about an
> undefined variable. I may have made a typo though.
want what you wrote or somewhat shorter:
my ($l, $o) = ($1, $1);
# hyperlinks
s/\[\[([^]]*)\]\]/
$l =~ s: :_:g;"[[file:$l.org][$o]]"/gex;