in reply to Configuration File
You can get access to the those variables in your script:debug = 1 [routers] router1 = 192.168.1.2 router2 = 192.168.1.3 router3 = 192.168.1.4 router4 = 192.168.1.5 router5 = 192.168.1.6 [groups] group1 = [router1,router5] group2 = [router1, router2, router3] group3 = [router2, router3, router4]
Hope I helped :)use Config::Tiny; my $conf = Config::Tiny->read('your_config'); my $debug = $conf->{_}->{debug}; my $routers = $conf->{routers}; # Hash ref with routers information my $groups = $conf->{groups}; # Hash ref with group information my $router1 = $routers->{router1}; # Router's IP my $group1 = $groups->{group1}; # Array ref with routers list which be +long to group 1. . . .
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
|
|---|