Use YAML. Here are just some highlights. Use YAML. It obviates the need to reinvent the wheel. Use YAML. It's easy.

NOTES ON DATASTRUCTURE The easiest way to visualize and understand the data structure: it is just like an Excel 'spreadhsheet workbook'. Each 'worksheet' represents an element of your model. Each worksheet holds one and only one 'table'.
You can create any level of heirarchy with this model simply by adding 'links'. You can easily translate this model in and out of a database because everything is organized as tables. You can easily translate this model into a directed graph. You can easily translate this model into just about *anything* you can represent digitally.

NOTES ON FIELDS

ADDITIONAL CONSIDERATIONS

The Code

### INIT script use strict; use warnings; use YAML; use Data::Dumper; my $dataroot = YAML::Load(join "", (<DATA>)); print $dataroot->{person}[0]{fname}; print "\n------------------\n"; print $dataroot->{person}[0]{lname}; print "\n------------------\n"; print $dataroot->{person}[0]{city}{caption}; print "\n------------------\n"; print Data::Dumper->Dump([$dataroot], [qw(dataroot)]); print "\n------------------\n"; 1; __END__ country: - &IDxCountryA name: CountryA caption: Country Alpha - &IDxCountryB name: CountryB caption: La Cuidad Del B - &IDxCountryC name: CountryC caption: United C Emirates state: - &IDxStateWashatovia name: washatovia caption: Washatovia country: *IDxCountryC - name: nervada_dc caption: Nervada D.C. country: *IDxCountryC city: - &IDxCityParisis name: Parisis caption: Parisis person: - fname: Samir lname: Krishnamurty city: *IDxCityParisis state: *IDxStateWashatovia country: *IDxCountryC

In reply to Re: Suggestions for design of a config/rules file by dimar
in thread Suggestions for design of a config/rules file by thens

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.