in reply to Get hash values in multidimensional array to populate Term document matrix

Hi,

your @arr array has never been populated with anything. So:

for my $i (0 .. $#arr){
isn't going to loop on anything.

I would suggest that you use the following pragmas:

use strict; use warnings;
as this will enable the compiler to point out at some of your probable mistakes.

Update: Sorry I probably looked at it too quickly, I missed the last push line.

Replies are listed 'Best First'.
Re^2: Get hash values in multidimensional array
by toolic (Bishop) on Feb 24, 2017 at 20:23 UTC
    your @arr array has never been populated with anything
    It is for me. When I run the 1st code snippet (no strictures), I see something in @arr:
    use Data::Dumper; print Dumper(\@arr); $VAR1 = [ [ { 'key' => 12, 'lop' => 9, 'pl' => 1 }, { 'key' => 12 } ] ];

    What happens when you run it? The 2nd snippet has compile errors for me.