Now that is one cool idea ! Correct me if i am wrong :

The Main "Script" Define:
GLOBAL $ERROR_RETURN_CODE

The children script would "set" the $ERROR_RETURN_CODE value before ending. Then the Parent script would use the value "setted by the child". \:\)
_________________________
Treat people the way you want to be treated.