The first one is a Useless Use of cat. Since you're going through the shell anyway:
system("mailx -s 'Title' emailaddresshere < $file");
Same applies for the second case - why bother monkeying in Perl if you're gonna shell out anyway?
system("/usr/sbin/ping $_ 2> /dev/null");____________ Makeshifts last the longest.