in reply to local vs. $self-> pointer to subroutine

Perl has a special - widely unknown - syntax for this:

my $func_Ref = \&$self->isInst; $self->$func_Ref( ... );

see OOP: Obj->Coderef for calling Private Methods for details.

Cheers Rolf

PS: But I'm not sure if the performance win does worth it. AFAIK Perl does a lot of optimization like method caching to speed things up.

UPDATE: typo fixed

Replies are listed 'Best First'.
Re^2: local vs. $self-> pointer to subroutine
by Anonymous Monk on May 23, 2011 at 18:36 UTC
    What are the criteria for calling it wildly unknown, that you didn't know it? :)
      Hi BUK!

      > What are the criteria for calling it wildly unknown

      Simple! Practically nobody mentions it.

      Search the archives and prove me wrong...

      Cheers Rolf

        Hi BUK!

        Hi! I am not BUK, or a BUK.

        Simple! Practically nobody mentions it.

        Whether somebody mentions it, or you know about it, doesn't make it unknown, or wildly unknown

        Search the archives and prove me wrong...

        Like your link shows, the documentation mentions it, proof enough.