http://qs321.pair.com?node_id=297534

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Please advise how I can call a subroutine in a die statement. I have a mail subroutine that I want to call if a file doesnt open and I want to get the error message to print out in my STDERR.
This is not working but this is what Iam trying to do:
sub mysub { mail stuff here.. } open(TMPFILE,"<datafile.txt") || die "Cant open: $!" mysub();