...and that syntax applied to the simpler version:
use strict; use warnings; use 5.010; my $data = "greeting"; $data =~ s{greeting} {my $repl = <<"END_OF_STR"; "$repl goodbye mars"; }e; hello world END_OF_STR say $data; --output:-- hello world goodbye mars
In reply to Re^2: Can't include a HEREDOC within RHS of a Regex
by 7stud
in thread Can't include a HEREDOC within RHS of a Regex
by wind
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |