use AtExit; eval { my $q = AtExit->new(sub{eval{}}); die "Oops\n"; }; print $@; # Prints nothing