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

You print out all that nice debug from Data::Dump and yet you don't show it here :)

  • Comment on Re^5: Yet another config file editing programme : Tell me how to make it better !

Replies are listed 'Best First'.
Re^6: Yet another config file editing programme : Tell me how to make it better !
by dazz (Beadle) on Sep 09, 2021 at 10:07 UTC
    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