in reply to Re: Can't include a HEREDOC within RHS of a Regex
in thread Can't include a HEREDOC within RHS of a Regex
...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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Can't include a HEREDOC within RHS of a Regex
by ikegami (Patriarch) on Jun 15, 2011 at 07:24 UTC |