RHS of s/LHS/RHS/ with $1, $2, etc. without "eval"?

The following script use strict; my ($text, $left, $right) = @ARGV[0..2]; my $text1 = $text; $text1 =~ s/$left/$right/g; print $text1; my $text2 = $text; eval ("\$text2 =~ s/$left/$right/g"); print $text2; prints $ ./substitute.pl monster '([aeiou])' 'X$1Y' mX$1YnstX$1Yr mXoYnstXeYr Is there any way to get the substitution as in $text2 without using