I would like to ask if it is possible to put another regular expression inside the RHS of a substitution match expression with the "e" modifier.
For example, I would like to replace any occurrence of the word stored in $foo with the same number of "-", case insensitive.
For example:
$str =~ s/($foo)/$temp = $1; $temp ~= s/./-//gie;
But it constantly gives syntax error when compiling, while
$str =~ s/($foo)/$temp = $1; $temp = "---"/gie;
does work.
I guess I did not properly escape the slashes, any ideas?