in reply to Have script send email if it dies

Tested:

{ local $SIG{'__DIE__'} = sub { ## insert here whatever way of sending a mail you prefer. For exam +ple: open my $mail, '|mail user@localhost' or die "open: $!"; print $mail shift; close $mail; }; die "dying...\n"; }

--
David Serrano