in reply to
Print statements inside a function call in a here-doc don't work
You may need
Capture::Tiny
Sorry if my advice was wrong.
Comment on
Re: Print statements inside a function call in a here-doc don't work
In Section
Seekers of Perl Wisdom