in reply to Evaluating $1 construct in literal replacement expression
Using eval, you can achieve your need,
I hope this would match your requirement.
First we are constructing the substitution, in that using the eval, the substitute pattern is evaluated. And then the total substitution has been evaluated.$_=q{nell'amaca}; my $search=q{nell'([[:alpha:]]+a)}; my $subst='na $1'; $expr = "s/$search/".eval $subst."/g"; eval $expr; print; print "\n";
I hope this would match your requirement.
In Section
Seekers of Perl Wisdom