$output = `mailq | grep frozen`; if ($output) { open(MAIL, "| mail -s sstock\@essex+.ac.uk"); print MAIL $output; close(MAIL); }