in reply to hiccoughing here documents

Another ugly approach based on 1003509 (Update: also at https://stackoverflow.com/questions/2422204/how-can-i-interpolate-the-result-of-a-function-in-a-perl-here-doc):
use strict; use warnings; sub MakeLine { return "Blah Blah param=$_[0]"; }; print << "HEREDOC"; First line of heredoc @{[ MakeLine(3) ]} @{[ MakeLine(543) ]} @{[ MakeLine("Some text also") ]} Last line of heredoc HEREDOC
Prints:
First line of heredoc Blah Blah param=3 Blah Blah param=543 Blah Blah param=Some text also Last line of heredoc

                All power corrupts, but we need electricity.