in reply to Catching Warnings and Showing Uninitialized Variables

Sometimes it's simpler to escalate warnings to the level of errors with

use warnings FATAL => 'all';

and then handling them just like an exception with an eval block.

More on warnings.

HTH.