in reply to Array to Array of hashes

Hi,

try this:

use strict; use warnings; use Data::Dumper; my @data = ( [ "JOHN JR", "10/30/2011", "Main Street", ], [ "JOE DOE", "11/30/1999", "Broke Street", ], [ "MARY DEE", "06/01/2014", "Pearl Street", ], ); my @AoH; for my $row (@data) { push @AoH, { NAME => $row->[0], DOB => $row->[1], ADDR => $row->[2 +]}; } print Dumper \@AoH;
This gives the following output:
$VAR1 = [ { 'NAME' => 'JOHN JR', 'DOB' => '10/30/2011', 'ADDR' => 'Main Street' }, { 'NAME' => 'JOE DOE', 'DOB' => '11/30/1999', 'ADDR' => 'Broke Street' }, { 'NAME' => 'MARY DEE', 'DOB' => '06/01/2014', 'ADDR' => 'Pearl Street' } ];
Please notice that I have made a number of changes to your original data (an array instead of an array ref, adding commas, adding a closing quote, etc.). Your original data would not even compile (at least not under use strict; use warnings;).