Hi
Here is the printout after running the program.
I have added some hand typed comments out towards the right of the print out.
$ perl ip3.pl ( "ip_params", # This is confirming the input +file has been correctly read. { domain_name_server_1 => "8.8.8.9", domain_name_server_2 => "8.8.4.9", interface => "eth0", ip_address => "192.168.10.9/24", routers => "192.168.9.91", }, ) ( "ip_params", # This is confirming that the f +ormat is correct for the output file. { domain_name_servers => "8.8.8.9 8.8.4.9", interface => "eth0", ip_address => "192.168.10.9/24", routers => "192.168.9.91", }, ) found section for eth0 at line 8 Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 73, <> line 9. ip param key : # a print of the hash key $0 is + blank Use of uninitialized value $1 in hash element at ip3.pl line 74, <> li +ne 9. Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 74, <> line 9. ip param val : # printing the hash value $1 is + blank. set ip_address to 192.168.10.9/24 Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 73, <> line 10. ip param key : Use of uninitialized value $1 in hash element at ip3.pl line 74, <> li +ne 10. Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 74, <> line 10. ip param val : set routers to 192.168.9.91 Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 73, <> line 11. ip param key : Use of uninitialized value $1 in hash element at ip3.pl line 74, <> li +ne 11. Use of uninitialized value within %ip_params in concatenation (.) or s +tring at ip3.pl line 74, <> line 11. ip param val : set domain_name_servers to 8.8.8.9 8.8.4.9 ending changes at line 12

So I can't figure out where or how $1 should be initiated.

Dazz

In reply to Re^6: Yet another config file editing programme : Tell me how to make it better ! by dazz
in thread Yet another config file editing programme : Tell me how to make it better ! by dazz

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.