in reply to how to trap errors?

eval BLOCK is what you want,

my $foo = eval { $obj->method(@args) }; warn "Oops! ", $@ if $@;

After Compline,
Zaxo