in reply to How to capture out of memory excpetion in perl?

I don't know any way in Perl to do this directly and I wouldn't be surprised if there isn't one.

One idea would be to write a Perl script which is calling a other Perl script using system( ) inside eval and test if it's returns an error. However this wouldn't be very clean and portable. Untested.