perl -e \'system (\"crontab1 -l\");print $?\'
returns -1 as expected (program crontab1 doesn\'t exist)
perl -e \'system (\"crontab1 -l|
The operating system returns an exit status only for the last program executed and if the OS doesn't return it, perl can't report it.
I don't know of any way to get at the exit code returned by earlier programs in a pipeline other than by running each individually and using temporary files instead of pipes.