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

Re: What Are The Rules For Subs And Modules When Fed Wrong Input

by dws (Chancellor)
on Jul 21, 2002 at 04:15 UTC ( [id://183765]=note: print w/replies, xml ) Need Help??


in reply to What Are The Rules For Subs And Modules When Fed Wrong Input

If I've written a sub or module which expects, say, three variables to be passed to it, what should it do when it gets two?

Consider CGI.pm as an exemplar. Return undef if an argument is missing and you can't substitute a reasonable default. die as a last resort.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found