in reply to Changing the name of STDOUT...

Well, your talk of complexity later on included; build it w/ the debug in and a non-mailing mode:
print MAILPIPE 'blah $blah' if $mailing; print STDERR "trying MAILPIPE 'blah $blah'\n" if $debug > 30;
so you can $mailing = 0; $debug =40; and get stderr and no mail. Just keep your debug in line w/ your MAILPIPE data as the code evolves.

a