my $obj = My::Object->new(); ... if ($!) { die "something bad happened: $!"; }