in reply to The return code from Perl is not returned to the application
Just a thought: If you have the perl debug, you can run the perl program to execute line by line using the debug option, it will help to give more visibility for you to troubleshoot.
In Section
Seekers of Perl Wisdom