Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re: The dreaded if-elsif-else construct (code)
in thread The dreaded if-elsif-else construct (code)

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)

  • Comment on Re: Re: The dreaded if-elsif-else construct (code)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-23 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found