Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Testing failures: How to override print to make it fail?

by adrianh (Chancellor)
on May 05, 2005 at 13:40 UTC ( #454360=note: print w/replies, xml ) Need Help??


in reply to Re^3: Testing failures: How to override print to make it fail?
in thread Testing failures: How to override print to make it fail?

adding "or die" to print is kinda ... dumb.

That entirely depends on the application being developed. I've come across several apps where not checking for the result of print has caused some nasty and expensive intermittent bugs.

(Which is why I wish that print, open, read, etc. threw exceptions by default if called in a void context... Fixed in Perl 6 I think?)

Update: and

use Fatal qw( print );

won't work since print is one of those subroutines that Perl can't override cleanly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://454360]
help
Chatterbox?
[shmem]: I'm a bit scared by agile (agile imposition) - but then it is crucial how it is lived to crucified or not
[shmem]: s/to cru/to be cru/
[moritz]: agile itself is pretty straight forward: faster feedback loops, working in smaller increments, regularly reflect and try to improve your process
[moritz]: it's just some implementations of agile that are scary
[shmem]: moritz: that sound somewhat reconciling to me
[shmem]: indeed these 3 points are the ones I'm missing most in my daily work

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-04-27 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (508 votes). Check out past polls.