Rodster001 has asked for the wisdom of the Perl Monks concerning the following question:
What I want to do is call "subroutine" by variable. For example:my $res = new Some::Package({ foo => bar })->subroutine;
That doesn't work, I've tried several variations of that (along with \&) and I can't quite get it. Can someone enlighten me?my $sub = "subroutine"; my $res = new Some::Package({ foo => bar })->( $sub );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling subroutine with a scalar
by philipbailey (Curate) on May 06, 2015 at 18:38 UTC | |
by Rodster001 (Pilgrim) on May 06, 2015 at 18:53 UTC | |
by jeffa (Bishop) on May 06, 2015 at 18:58 UTC |