#!/usr/bin/env perl use Exception::Class; # try eval { (my $result = (23/0)); }; # catch if ( my $e = Exception::Class->caught() ) { # You can rethrow the exception with your own like MyException here die "ERROR: division by zero\n$e\n" }