added exit code for the perl script