Proper perl execution Don't use # running program system("/bin/program arg1 arg2"); # getting the output $output = `/bin/ls -lR directory`; open(FOO, "/bin/ls -lR directory|"); # sending input open(FOO, "|/usr/bin/nc webserver 80"); Do use system "/bin/program", "arg1", "arg2"; # getting output open(FOO, '-|') || exec '/bin/ls', '-lR', 'directory'; # sending input open(FOO, '|-') || exec '/usr/bin/nc', 'webserver', '80';