Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Being more Assert-ive with Perl

by kappa (Chaplain)
on Sep 17, 2004 at 16:18 UTC ( [id://391826]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Being more Assert-ive with Perl
in thread Being more Assert-ive with Perl

I like the idea of a tool, but why turn off all runtime contract checks? Wouldn't you want them in there to catch the errors?

What's the point of testing the code below with something but positive numbers?

is_numeric($_[0]) && $_[0] > 0 or die "Invalid input, give me a positi +ve number\n"; # is_numeric taken from perlfaq4

This check is here for a reason and we'd like to test the reasoning. Will it die horribly trying to multiply a hashref by two or taking a square root of -100? Will it just plain lie?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://391826]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-20 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found