Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Test code:@data = [ [ "JOHN JR", "10/30/2011", "Main Street, ] [ "JOE DOE", "11/30/1999", "Broke Street", ] [ "MARY DEE", "06/01/2014", "Pearl Street", ] ]
#!/usr/bin/perl use strict; use warnings; my @AoH; for my $row ( 0..$#data ) { push @AoH, { NAME => $data[0], DOB => $data[1], ADDRRESS => $data[2], }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array to Array of hashes
by kcott (Archbishop) on Oct 27, 2015 at 16:51 UTC | |
|
Re: Array to Array of hashes
by NetWallah (Canon) on Oct 27, 2015 at 16:33 UTC | |
by Anonymous Monk on Oct 27, 2015 at 17:34 UTC | |
|
Re: Array to Array of hashes
by GotToBTru (Prior) on Oct 27, 2015 at 16:38 UTC | |
|
Re: Array to Array of hashes
by stevieb (Canon) on Oct 27, 2015 at 16:41 UTC | |
|
Re: Array to Array of hashes
by Laurent_R (Canon) on Oct 27, 2015 at 16:46 UTC |