in reply to Re^2: How to call subroutines using variables ?
in thread How to call subroutines using variables ?
which worked fine. But in CGI::Application I'm using $self->, as in:
$self->$all_subs[1]->();
Use:
my $code=$all_subs[1]; $self->$code();
This will call $code as a method on $self, which AIUI is what you want. If you would like to do the same without an intermediate variable, then I wondered too and it turns out to be possible, albeit in a somewhat convoluted way.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to call subroutines using variables ?
by bradcathey (Prior) on Jun 09, 2007 at 19:48 UTC | |
by chromatic (Archbishop) on Jun 10, 2007 at 04:23 UTC | |
by bradcathey (Prior) on Jun 10, 2007 at 12:25 UTC | |
by chromatic (Archbishop) on Jun 10, 2007 at 17:32 UTC | |
by blazar (Canon) on Jun 10, 2007 at 07:32 UTC |