in reply to Can't include a HEREDOC within RHS of a Regex

I've reduced this code to the following example:

Too complicated. Same error here:

my $data = "greeting"; $data =~ s{greeting} {my $repl = <<"END_OF_STR"; hello world END_OF_STR "$repl goodbye mars" }e;