in reply to Get hash values in multidimensional array to populate Term document matrix
You may find changing $j to $hr so you know it's a hashref makes things a bit clearer.
poj#!perl use strict; use Data::Dumper; my %hash = ( key => 12, pl => 1, lop => 9 ); my %hash2 = ( key => 12, pl => 1, lo => 9 ); my @arr = ( [\%hash,\%hash2] ); for my $i (0 .. $#arr){ my $subd = @{$arr[$i]}; print "subLen: $subd\n"; for my $hr (@{$arr[$i]}){ for my $key (keys %$hr){ print $key.": ".$hr->{$key}."\n"; } } }
|
|---|