in reply to Re: call sub in string
in thread call sub in string

While in principle you are correct that dispatch tables are a good idea for this kind of thing, I would say that for this case or at least given how this case was posed dispatch tables would be overkill.

The easier way to accomplish his goal without using symbolic refs and without using a disptach table is to simply loop over a list of subrefs.

foreach my $sub (\&function_1,\&function_2) { $sub->(); }
Of course Im somewhat curious why any good programmer would handroll numbered functions (i can see it with autogenerated subs, kinda), but I suspect our OP is a bit new to 'tings.

:-)

Yves / DeMerphq
--
When to use Prototypes?