Properl Perl execution Better yet, don't use system or exec in perl at all -- use internals Don't use ls, use fileglobs, stat, and friends. Don't use nc, use IO::Socket. Don't use md5sum, use Digest::MD5. Don't use /usr/sbin/sendmail, use Net::SMTP, etc. etc, etc, etc. If you want to specify argv[0] ($0 in perl) then use exec { "/bin/gzip" } "gunzip", "file.gz"; More helpful open and IPC hints in perldoc perlopen perldoc perlipc