Re: How to dynamically generate function name and call it?
- From: "Brian McCauley" <nobull67@xxxxxxxxx>
- Date: 27 Sep 2006 09:52:41 -0700
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).
.
- Follow-Ups:
- Re: How to dynamically generate function name and call it?
- From: Uri Guttman
- Re: How to dynamically generate function name and call it?
- References:
- Re: How to dynamically generate function name and call it?
- From: Tad McClellan
- Re: How to dynamically generate function name and call it?
- Prev by Date: Re: How to initialize class data?
- Next by Date: Re: Spread***::ParseExcel on Windows with out Win32::OLE
- Previous by thread: Re: How to dynamically generate function name and call it?
- Next by thread: Re: How to dynamically generate function name and call it?
- Index(es):