Spickachu has asked for the wisdom of the Perl Monks concerning the following question:

I feel like this is sorta cheating. It's crude but I don't get paid enough to do anything more fancy for now!
# file: open STDOUT, ">mailq_check.log"; system "mailq | grep frozen"; close STDOUT; exec `perl mailq_check.log`;
# file: while (<>) { @array = $_; $mail_fault_cnt++; } if ( $mail_fault_cnt > 0 ) { exec `more mailq_check.log| mail -s MailQ_Error sstock\ +k`; }