in reply to can PERL just quit?

Another way to do it would be to put an eval block around more-or-less “all of it,” then check the result afterward.   If the process throws a runtime error, it will be caught here, and you can output something that will help you to resolve the problem.   In any case, you can force the Perl script to generate some STDERR output in all cases, which is what the Java wrapper seems to be looking for.

Sometimes I define a variable outside of the eval-block, called $doing_what which I populate with some string (initially "nothing"), changing it along the way, specifically to use it in any caught error-messages.   Whatever the string is found to contain will at least indicate that the failure occurred very-shortly after the statement which set the variable to this particular value.   While it might be a low-tech way to do it, it works well.   Just be very sure that no statement which assigns a value to that string can itself encounter a runtime error, and that the variable is never undef.

Replies are listed 'Best First'.
Re^2: can PERL just quit?
by Anonymous Monk on Jun 09, 2014 at 22:20 UTC
    Putting autodie sounds simpler, will it throw an error on all cases?
    A reply falls below the community's threshold of quality. You may see it by logging in.