"system" command and unix exit codes

Greets all.

I'm looking for a way to get the exit code of a unix command after it is run using MEL's "system" command. I've played with MEL's "catch" keyword, but this just returns the status for MEL commands and not the exit code for the unix command.

I am basically wanting to run a perl script from MEL and capture the results and the exit status that the perl script returns. From what I can tell, MEL's "system" command doesn't seem to do anything with exit codes.

Also, I tried the work around below and was hoping to pull the exit code off the end of the $results string array, but it didn't work. I would get the perl script output in $results but no exit code.

$results = system "myPerlScript.pl; echo $status"

Any ideas on how to grab that exit code? If it matters, I'm using Maya 3.0.1 on Irix 6.5 with C shell as my default shell. Thanks for any ideas...

-Scott