in reply to Re: CPAN modules failing to check for write errors (fix it)
in thread <rant>CPAN modules failing to check for write errors</rant>

Extend Fatal to support universally overriding print / syswrite / printf etc. such that failures are reported.

This is an interesting idea. Did you have any ideas about how this might be done other than doing something s///-like to the optree?

Match (?:print|syswrite|printf|etc).

print

Replace it with $1 || carp( "$1 has failed catastrophically: $!" )

or
   print
      ...
   entersub
      ...

Is that what you were proposing? Can you think of any way to perform a net-equivalent operation without requiring that the optree be altered?

  • Comment on Re: Re: CPAN modules failing to check for write errors (fix it)