Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Re: The dreaded if-elsif-else construct (code)by bastard (Hermit) |
on Nov 17, 2001 at 08:32 UTC ( [id://125998]=note: print w/replies, xml ) | Need Help?? |
One thing that could extend this approach and possibly eliminate
the large quantity of ifs is to templatize the conditional.
Set it up so that the test and actions are defined in a config file and work via a generic test/action method. Granted the performance will probably drop, but the maintainability should increase. There also might be modules that support this sort of templating of a function, but i haven't seen them yet. (as i haven't had the need yet)
In Section
Seekers of Perl Wisdom
|
|