Re: How to dynamically generate function name and call it?



Tad McClellan wrote:

my %actions = ( # a "dispatch table", untested
TRAC => \&CreateTRACTable,
TRCO => \&CreateTRCOTable
);

There are two entries in that hash. A soon as you add another one
you'll hit the rule-of-3. You'll be manually doing the same thing three
times in succession. In programming this is generally a sign that you
are doing it wrong. This is no exception. You probably should be
going down the symbolic references path. There are a lot of reasons not
to use symbolic references in a lot of contexts. This leads some
people, most vocally Tad, to say they are always a bad thing. And
indeed I'll admit that in some purist sense they are always a bad
thing. But in this case they are not as bad as breaking the rule-of-3
(IMNSHO).

.