http://www.perlmonks.org?node_id=551785


in reply to Indented HEREDOC?

I think Filter::Indent::HereDoc does this. I haven't used it, however.