in reply to The dreaded if-elsif-else construct (code)
A hierarchical data structure is a natural for an XML document. For your case it could look like this:
Producing this file should be relatively easy using File::Find to load up a data structure and one of the XML modules for dumping the data structure.<data> <sprocket_logs> <spacely>200</spacely> </sprocket_logs> <cog_logs> <cogswell>100</cogswell> <astro>1</astro> <maimed_a_robot /> </cog_logs> </data>
Then you have many choices for eliminating your big switch statement. Here are a few ideas that came to mind; there are better ideas, also:
It should work perfectly the first time! - toma
|
|---|