in reply to printing output of a perl script to the Email body

If you just need to catch the output of your script and send it in an email, and your Perl was built with PerlIO (default since 5.8 — you almost certainly have it), you can reopen STDOUT to an in-memory "file" or simply select a different filehandle opened to an in-memory file.

Something like: (untested)

my $MailText = ''; open MAILOUT, '>', \$MailText or die "open in-memory output: $!"; select MAILOUT; # ... print "foo\n"; # ... print "bar\n"; # ... close MAILOUT; select STDOUT; # $MailText now contains "foo\nbar\n"; send it however you want