in reply to Informix ouput mailed without subject?

Unless you're determined not to use modules, I'd use Mail::Mailer;
if (/^MAIL/) { sendmail ($mailfrom, $mailto, $subject, $body); } sub sendmail { my ($from, $to, $subject, $body) = @_; my $mailer; eval { $mailer = Mail::Mailer->new('sendmail'); }; if ($@) { warn "Couldn't send mail: $@"; } else { $mailer->open({ From => $from, To => $to, Subject => $subject }); print $mailer $body; unless (close ($mailer)) { warn "Couldn't close mailer: $!"; } } }