If you want to send mail from Perl you have many choices, incuding
Mail::Send and others. It really doesn't matter whether STDIN and STDOUT are available or not. If you really
do need to pipe data to another process directly from your script, you might want to look at
perlopentut.