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

At the very least, if isInst is a method, then it will be expecting $self as its first argument, so you'd need to do

my $func_Ref = \&$self->isInst; foreach my $var ( @something ) { &$func_Ref( $self, $var ) }

Or better (IMO):

my $func_Ref = \&$self->isInst; foreach my $var ( @something ) { $func_Ref->( $self, $var ); }

But do profile to ensure this is your bottleneck, and benchmark to verify the gains are sufficient to warrant the obfuscation.

And if the performance of this loop is important enough to consider tolerating that level of obfuscation, you can gain a bit more by using a postfix loop:

my $func_Ref = \&$self->isInst; $func_Ref->( $self, $_ ) for @something;

I'd use the postfix loop here anyway.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.