in reply to Perl script ran from Java Bean
You could start by adding proper error handling to your Perl code. I see that you're not checking return values of your open()s. There could be more in the code that we don't see.
I'd say your best bet is to figure out the exact location where the script is die()ing. Then you can start thinking about why it may be doing that.
--perlplexer