Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Omitted subroutine arguments

by moritz (Cardinal)
on Mar 15, 2011 at 09:17 UTC ( [id://893265]=note: print w/replies, xml ) Need Help??


in reply to Omitted subroutine arguments

arg1, , arg3 and arg1, arg3 are exactly the same to perl, it simply ignores the additional comma.

So you can't really omit an argument. In Perl 5, arguments are simply passed as a list. You can use an empty string or undef or any value that pleases you, but "omitting" doesn't really work.

Maybe it will make your code clearer if pass a hash reference of arguments instead?

draw({ what => 'circle', cx => 100, cy => 50, radius => 2, })

or some such.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found