in reply to Re: How to print called program to stdout
in thread How to print called program to stdout

This may not be what you're looking for, but when I'm testing a script, I redirect STDERR to print to STDOUT. That way I can pepper my script with print statements to see what is going on so that I can debug it. This is how I do it:

BEGIN { $| = 1; open(STDERR, ">&STDOUT"); print "Content-type: text/html\n\n"; }

Hope that assists you.