Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Default subroutine parameters

by samgold (Scribe)
on Apr 23, 2002 at 03:47 UTC ( [id://161205]=note: print w/replies, xml ) Need Help??


in reply to Default subroutine parameters

Could you check the number of arguments using $#argv and use an if statement to define it or not.
if ($#argv == 0){ $foo = 'default'; }else { $foo = shift; }
or something like that. I hope that helps.

Sam

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found