in reply to Handling errors on perl

You should consider using the module Try::Tiny rather than 'eval', especially if you are familiar with its concept from another language.
Bill