On Mon, Oct 28, 2013 at 4:26 PM, Achim Gratz wrote: > Peter Davis writes: > > That was the first thing I tried, and Perl complained about an > > undefined variable. I may have made a typo though. > > Nope, my error. $1 gets clobbered by the second replacement. So you'd > want what you wrote or somewhat shorter: > > # hyperlinks > s/\[\[([^]]*)\]\]/ > my ($l, $o) = ($1, $1); > $l =~ s: :_:g; > "[[file:$l.org][$o]]"/gex; > > Yes, that works beautifully, and is nice and concise. Thank you! -pd -- ---- The Tech Curmudgeon http://www.techcurmudgeon.com