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!