in reply to Storing/Calling References to Instance Methods

You need to create a closure instead:
$md_config->{"[cust_num]"} = sub { $web_services->GetCustomerNumber(@_ +) };
That puts one extra subroutine call on the stack though. If you have anything that is stack-sensitive (calls caller, for example), you'll need to use a goto to get rid of that extra hop:
$md_config->{"[cust_num]"} = do { my $meth = $web_services->can("GetCustomerNumber"); sub { unshift @_, $web_services; goto &$meth; } };

Replies are listed 'Best First'.
Re^2: Storing/Calling References to Instance Methods
by mlong (Sexton) on Sep 20, 2007 at 16:38 UTC
    Thanks merlyn. You are the man!

    For a minute I thought I had maybe stumbled upon a way to obtain the value the pointed to function returns by just accessing it via the $obj->{$key} deref mechanism. That would be cool. I don't suppose that is actually possible is it?

    Thanks again.

    -Matt
      You could create a tied hash where $tied{$key} calls the "Get" function. But i think that would just obfuscate in this situation.