$ perl -e'$res = `egrepa 2>&1`; print "$?:$!\n"; print $res' -1:No such file or directory (( Perl tried to execute egrepa, couldn't, and returned an error. Perl doesn't output error messages for you. )) $ perl -e'$res = `egrepa "" 2>&1`; print "$?:$!\n"; print $res' 32512: sh: egrepa: command not found (( Perl sees a shell command, and successfully executed the shell. The shell couldn't execute egrapa "", so it displayed and returned an error. ))