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

Re: Predefining sub Parameters

by bageler (Hermit)
on Jun 22, 2005 at 17:31 UTC ( #469109=note: print w/ replies, xml ) Need Help??


in reply to Predefining sub Parameters

of course, you can't have an array as a second parameter if you expect scalar params later in the list, so you'd want to pass an arrayref to line things up like that.
You might check for appropriate values like this:

sub functionname { $a = shift; $b = shift; $c = shift; warn unless (ref \$a =~ /SCALAR/); warn unless (ref $b =~ /ARRAY/); warn unless (ref \$c =~ /SCALAR/); }
Or you might pass your data as a hash, and check that the appropriate keys are there.


Comment on Re: Predefining sub Parameters
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-23 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls