Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Get hash values in multidimensional array

by poj (Abbot)
on Feb 24, 2017 at 20:25 UTC ( [id://1182760]=note: print w/replies, xml ) Need Help??


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.

#!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"; } } }
poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1182760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 07:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found