-------------------------------------------------- open(STDOUT, ">mailq_check.log"); system("mailq| grep frozen"); close STDOUT; exec(`perl mail_report.pl mailq_check.log`); -------------------------------------------------- while (<>) { @array = $_; $mail_fault_cnt++;} if ($mail_fault_cnt>0) { exec (`more mailq_check.log| mail -s MailQ_Error sstock\@essex.ac.uk`);}