Hello Monks,
I am having a problem finding a efficient way of using a configuration file for my script.
Here is a example:
##Router Identification router router1 = 192.168.1.2 router router2 = 192.168.1.3 router router3 = 192.168.1.4 router router4 = 192.168.1.5 router router5 = 192.168.1.6 ##Set up groups group1 = router1,router5 group2 = router1, router2, router3 group3 = router2, router3, router4
This would be stored in a configuration (text) file, lets say it is called "router.conf".
I want to load the router section into a hash.
I want to load each to which group to load, and whichever group I load, I want it to be a list or a hash.
Should I be using AppConfig??? If so how??
Thank You,
<TAB>Otter

In reply to Configuration File by crackotter

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.