in reply to Modelling a data structure
Something like YAML seems well-suited for your means. The configuration in a YAML file will translate directly to your datastructure.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modelling a data structure
by sch (Pilgrim) on Feb 07, 2007 at 16:55 UTC | |
Plan B was going to be to go with an XML config file, but given that once this is setup it won't get changed very often. But thanks for the suggestion. Simon | [reply] |
by graff (Chancellor) on Feb 08, 2007 at 04:38 UTC | |
You mean something like this? But... what? Looks pretty simple to me. I'd rather not have all those data values hard-coded in the perl script itself, and reading them from a basic xml file seems like a no-brainer. I guess it's a little goofy that there are two layers in XML::Simple's "default" hash structure that are sort of useless ("file" and "field"), but if you tried a different way of structuring the xml (and/or spent some time with the XML::Simple man page), you could probably improve on that. (Or you could just use the default as-is and get done quicker.) | [reply] [d/l] |