variation on (?) call subroutine by reference

A

Alison Bowes

I know that if $subname contains the name of the subroutine I want to call,
I can call that subroutine via
&$subname;

However, my subroutine names are in an array, so if I want to call
$subname[3] I've tried
&$subname[3];

But, that doesn't work, and I'm not having much luck finding such an
example. If I'm doing something truly numbskulled, I do apologize!

I do realize I could go this route:
$this_sub = $subname[3];
&$this_sub;

That just seems so clunky and unnecessary, no?

TIA,
Alison
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top