Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Prototypes allow overloading subs?

by alien_life_form (Pilgrim)
on Dec 04, 2002 at 14:15 UTC ( #217480=note: print w/replies, xml ) Need Help??


in reply to Prototypes allow overloading subs?

Greetings,

Mmmhhhh...
Not the java way for sure. If anything, I'd go the python way:

def foo(one,two=None,*args,**kwargs) : pass
So I can say:
foo(1) foo(1,2) foo(two=3,one=4,'fubar',three=42)
While perl's way may be too free form sometimes, trying to work around - for instance - C# idea of not allowing default values for arguments is a royal pain in the backend.
Cheers,
alf
You can't have everything: where would you put it?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-01-28 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (73 votes). Check out past polls.

    Notices?