if($ct == 1) { print FIL "\n$ct is down at this time.\n"; open(FIL,">>$myfil") || die "No open for ct tot: $! \n"; system("mailx -s 'Mail header' myemail < $myfil"); close(FIL); } elsif($ct >= 2) { print FIL "\n$ct are not available at this time.\n"; open(FIL,">>$myfil") || die "No open for ct tot: $! \n"; system("mailx -s 'Mail header' myemail < $myfil"); close(FIL); } close(FIL);