Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Dynamic Method Calls

by runrig (Abbot)
on Aug 28, 2001 at 01:33 UTC ( [id://108281]=note: print w/replies, xml ) Need Help??


in reply to Re: Dynamic Method Calls
in thread Dynamic Method Calls

You can avoid one method lookup by going:
if (my $code = $pack->can($string)) { &$code($pack, $string); );

Replies are listed 'Best First'.
Re: Re: Re: Dynamic Method Calls
by dragonchild (Archbishop) on Aug 28, 2001 at 01:42 UTC
    Method lookups get cached, so this isn't really needed. You're actually duplicating the caching efforts that the interpreter does for you.

    ------
    /me wants to be the brightest bulb in the chandelier!

    Vote paco for President!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found