in reply to Re: Config file to tree format with id, parent, key, value
in thread Config file to tree format with id, parent, key, value
And here is the output repeated (because "request_snapshot" appears many times in my config):#!/usr/bin/perl use warnings; use strict; use Config::General; my $conf = Config::General->new("fh.cfg"); my %config = $conf->getall; my @myarray = (); while( my( $key, $value ) = each %config ){ print "$key: $value\n"; if (ref($value) eq 'ARRAY'){ @myarray = @$value; foreach (@myarray) { print "$_\n"; } } }
(...) status_interval: 30; exchange_is_active_time_end: "16:00"; dropout_detection_initial_interval_secs: 600; request_snapshot: ARRAY(0xce97a8) false; false; false; false; (...)
|
|---|