http://www.perlmonks.org?node_id=454292


in reply to Testing failures: How to override print to make it fail?

How do I override the print function to make it fail?

Another alternative to the others offered is to encapsulate the dying-print in a subroutine and then override that. I like this solution myself since it saves sprinkling "or die" everywhere.