in reply to Re: Apache::ConfigFile iterate problem
in thread Apache::ConfigFile iterate problem
Hi,
I have tried that bevore.sub iterate_hash { my $ref = shift; foreach (keys %$ref) { if (ref($ref->{$_}) eq "HASH") { iterate_hash($ref->{$ +_}) } if (ref($ref->{$_}) eq "ARRAY" ) { iterate_array($ref- +>{$_})} else { print "$_ maps to $ref->{$_}\n" } } } sub iterate_array { my $ref = shift; foreach (@$ref) { if (ref($_) eq "HASH") { iterate_hash($_) } if (ref($_) eq "ARRAY" ) { iterate_array($_) } else { print "Array: $_\n" } } } &iterate_hash(\%vh);
It didnt work out for me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Apache::ConfigFile iterate problem
by mr_mischief (Monsignor) on Sep 07, 2010 at 06:05 UTC | |
by tpais (Novice) on Sep 07, 2010 at 11:20 UTC | |
|
Re^3: Apache::ConfigFile iterate problem
by roboticus (Chancellor) on Sep 07, 2010 at 11:01 UTC |