in reply to perl/linux ulimit -f question

When you exceed a limit (most of them, anyway), your program is immediately aborted. The shell notices this, and prints the message. There's no way your program could capture that message, as it has already been forcibly terminated.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.