Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Good use for prototypes. On methods no less!

by polymorpheus (Novice)
on Jun 01, 2012 at 19:55 UTC ( #973860=note: print w/replies, xml ) Need Help??


in reply to Re: Good use for prototypes. On methods no less!
in thread Good use for prototypes. On methods no less!

Prototypes do nothing on method calls. There is plenty of talk about this in various forums. So they do not affect good users.

If someone tries to call UNIVERSAL::isa(...) with arguments (what use would it be otherwise) they will get the compile time error.

For example, this:

> perl -e 'sub method() { }; main->method(1, 2, 3);'
works, but this:
> perl -e 'sub method() { }; main::method("main", 1, 2, 3);' Too many arguments for main::method at -e line 1, near "3)" Execution of -e aborted due to compilation errors.
does not.

Replies are listed 'Best First'.
Re^3: Good use for prototypes. On methods no less!
by Eliya (Vicar) on Jun 01, 2012 at 20:04 UTC
    Prototypes do nothing on method calls.

    Ah, sorry, I misread...   I thought you were suggesting that they should work with methods, too, and that this way all kind of problems (including the example presented) could be solved.  My bad!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973860]
help
Chatterbox?
[Discipulus]: LanX the fact is that my js ability is even poorer than my Perl one..
[LanX]: oh its negative? ;P
[Discipulus]: my warmest comprehension karlgoethebier ;=(
[Discipulus]: yes LanX.. is so good to be appreciated (I fortunately have a big self estimation that compensate)
[LanX]: you can manipulate a html tree by addressing and replacing so called document objects (DOM) and from my experience the same methods can be used with any XML, though I didn't test all browsers yet
LanX just joking, playing "ego judo"
[marto]: good morning all
[Corion]: Hi marto!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2017-03-23 09:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (285 votes). Check out past polls.