Detect failure more reliably 

eval {
    my $obj = Class->new()
    do_something($obj);
    1;
} or do {
    die "Error in do_something(): $@";
}