I would like to ask if it is possible to add another regular expression inside the RHS wildcard matching expression using the modifier "e".
For example, I would like to replace any occurrence of a word stored in $ foo, with the same number "-" , case insensitive.
For instance:
$str =~ s/($foo)/$temp = $1; $temp ~= s/./-//gie;
But it constantly gives a syntax error when compiling, and
$str =~ s/($foo)/$temp = $1; $temp = "---"/gie;
really works.
I believe that I did not correctly avoid slashes, any ideas?
source
share