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

Re: goto superclass method

by ikegami (Pope)
on Dec 22, 2004 at 17:57 UTC ( #416844=note: print w/replies, xml ) Need Help??


in reply to goto superclass method

Why? The latter sounds like a useless "optimization" to me, especially since you say the first one works. If there is a reason, let us know and maybe we can address the real problem.

And no, there's no easy way that wouldn't require heavy symbol table manipulation. Well, maybe a module, but I find that unlikely.

Replies are listed 'Best First'.
Re^2: goto superclass method
by Ovid (Cardinal) on Dec 22, 2004 at 18:05 UTC

    Actually, it's very easy to do, as shown in my reply below. can returns a code ref and you can goto a code reference. The only tricky part is writing code that pulls in the entire inheritance heirarchy in the correct order so it can be searched. I suspect the original poster may find that less fast than "optimizing" the stack (if that's what was intended.)

    Cheers,
    Ovid

    New address of my CGI Course.

      can returns a code ref

      I did not know that until I saw your snippet below. Very nice!

Re^2: goto superclass method
by avarus (Novice) on Dec 22, 2004 at 18:01 UTC
    I never said I thought it was a good idea - I just want to know how it can be done!
    TIM
    --
    #Tip: use 'no strict' to make those nasty errors vanish.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2019-03-27 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (125 votes). Check out past polls.

    Notices?