use strict; use warnings; use Carp; # Configure the warn signal handler to print the stack trace provided by Carp. $SIG{__WARN__} = sub {print STDERR Carp::longmess(@_); }; run(); sub run { my $code = eval 'sub { my $a = 1 - undef; };'; $code->(); }