Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: How to Ask a Question (With Test::More) (repost, now with Sitedocclan approval.)

by BrowserUk (Patriarch)
on Aug 06, 2005 at 11:27 UTC ( [id://481471]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to Ask a Question (With Test::More) (repost, now with Sitedocclan approval.)
in thread How to Ask a Question (With Test::More)

Quite frankly, I think that in most instances, it is simple better to allow Perl to detect these kind of trivial errors, It most times does a better job of reporting the nature of the problem than the programmer will:

#! perl -slw use strict; sub times7 { return $_[ 0 ] * 7; } print "times7( $_ ) returned:", times7( $_ ) for 1, 2, 3, 0, undef, 'f +red'; __END__ P:\test>junk times7( 1 ) returned:7 times7( 2 ) returned:14 times7( 3 ) returned:21 times7( 0 ) returned:0 Use of uninitialized value in concatenation (.) or string at P:\test\j +unk.pl line 8. Use of uninitialized value in multiplication (*) at P:\test\junk.pl li +ne 5. times7( ) returned:0 Argument "fred" isn't numeric in multiplication (*) at P:\test\junk.pl + line 5. times7( fred ) returned:0


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
  • Comment on Re^3: How to Ask a Question (With Test::More) (repost, now with Sitedocclan approval.)
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found