in reply to Return codes to calling program
Give your return code as the parameter to the exit call, it will be passed on to the calling programme.
See perldoc -f exit
Cheers, Sören