On Jan 24, 2007, at 1:25 PM, Nik Clayton wrote:

Chris Dolan wrote:
I don't like that very much. The implicit die() on test functions will probably confuse subsequent readers of the code.

   # Cause the listed functions to die on error
   use Fatal qw(...);

Furthermore, I cannot believe that ALL of your tests are critical.

150 or so out of 158.  So the

   ... or die "redundant error message: $!";

gets quite old quite fast.

N

Wow, 150/158? That's a high fraction. I still think the following is somewhat more readable, but you are clearly in a different space from the testing I usually do, so perhaps MHO doesn't apply.

  sub bail { die "redundant error message: $!"; }
then 150 instances of "... or bail;" One advantage of that approach is that you can add cleanup code to bail() if needed, although you could probably do that in an END{} block instead.

Chris

--
Chris Dolan, Software Developer, http://www.chrisdolan.net/
Public key: http://www.chrisdolan.net/public.key
vCard: http://www.chrisdolan.net/ChrisDolan.vcf



Reply via email to