open(MAIL,"|mailx blah) || die "No mail stuff: $! \n"; if($ct == 1){ print MAIL "\n$ct is down at this time.\n"; } elsif($ct >= 2){ print MAIL "\n$ct are not available at this time.\n"; } close(MAIL);