in reply to Re: forked die() in eval block has counterintuitive behavior?
in thread forked die() in eval block has counterintuitive behavior?

Yes -- when you attack the problem, you may want to examine my patch to Mail::Mailer, which patch fixes the problem by doing two things:
  1. Eval the child code (which ideally performs and exec and hands off the baton to sendmail/whatever); if the child code dies, warn the error and exit(1);
  2. So that someone using Mail::Mailer has a way of knowing it went wrong, check the return value from closing the filehandle that had been opened on the child process; die here (in the parent!) if a problem.
But heavens to Betsy! this is a pernicious problem. I had originally suspected that fork() was being called, so I overrode CORE::GLOBAL::fork with a debugging message and stack trace -- all to no avail, since it was the open("|-") style of forking that was being used in Mail::Mailer.
  • Comment on Re^2: forked die() in eval block has counterintuitive behavior?