in reply to Re^2: Here documents in blocks
in thread Here documents in blocks

> If the same trick is attempted with a print statement, Perl complains that we Can't modify print in substitution (s///).

That's why the /r flag was introduced. try s///r

update

print <<"HEREDOC" =~ s/^\s+//gmr; # <- works your text goes here HEREDOC __END__ your text goes here

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery