sub print_hash { my ($temp, $spacer)=@_; my $key; foreach $key (keys(%$temp)) { print "$spacer\ key=$key\tElement=". %$temp->{$key}. "\n"; if (%$temp->{$key} =~/ARRAY/) { print_array(%$temp->{$key}, $spacer." "); } }print "\n"; } sub print_array { my ($array, $spacer)=@_; my $i; foreach $i (@$array) { print "$spacer\ $i\n"; if ($i =~ /HASH/) { print_hash($i, $spacer." "); } } print "\n"; }