in reply to
Substitution problem
Untested:
s{(-(.+?)-)}{$hash{$2} // $1}eg;
[download]
This assumes 5.10 or later.
Comment on
Re: Substitution problem
Download
Code
In Section
Seekers of Perl Wisdom