[ "--collect" ] becomes [ "--collect", "--brief" ],
e.g. do they represent sets were the order doesn't matter?
You've been provided with two solutions, Hippo mentioned modules I've sketched an algorithm.
I think it's time for you to wet your feet and come up with an SSCCE plus test suite for this special kind of data.
Unfortunately we are not telepathic, we can't help you with fuzzy requirements of an alien cfg format.
I strongly recommend you implementing the recursive walker (many examples in the archives) which dives into your data and handles scalars, arrays and hashes by type.
Then you play around and handle special edge cases AND semantics, like one array is supposed to be a set, the other one is ordered an so on ...
That way you'll also get at least a validator for your "user supplied" cfg-format.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^4: Augmenting and reducing data structures
by LanX
in thread Augmenting and reducing data structures
by sciurius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |