Perl eval can be used as try and catch exception handling.
eval { # try }; if($@) { # catch }
eval { # try die "Exception text to be catched"; }; if($@) { # catch }