sub trav_hash { my $ref = shift; my $type = ref $ref; if( $type eq 'HASH' ) { trav_hash( $ref->{$_} ) for keys %$ref; } elsif ( $type eq 'ARRAY' ) { handle_array( $ref ); } else { die "something weird is in our structure!"; } } sub handle_array { my $arrayref = shift; # do whatever we want with the array here.... } trav_hash( \%data );
In reply to Re: Accesing hash of unknown dimension
by friedo
in thread Accesing hash of unknown dimension
by Otogi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |