if ($ct > 0) { open(FIL, ">>$myfil") || die "Write to $myfil failed\n"; print FIL "\n$ct "; print FIL ($ct > 1)? "are not available" : "is down"; print FIL " at this time.\n"; close (FIL); system("mailx -s 'Mail Header' myemail < $myfil"); }