#! perl -w use strict; use Data::Dumper; my $transaction_record_fields_method1 = [ { 'Batch_Agency' => [ 1 .. 3] }, { 'Batch_Date' => [ 4 .. 11] }, { 'Batch_Type' => [ 12 .. 12] }, ]; #### # Accessing an AoA my $transaction_record_fields_method2 = [ [ 'Batch_Agency', [ 1 .. 3] ], [ 'Batch_Date', [ 4 .. 11] ], [ 'Batch_Type', [ 12 .. 12] ], ]; print Dumper($transaction_record_fields_method2->[2][0]); print Dumper($transaction_record_fields_method2->[2][1]); # Accessing a plain ol' AoH my $transaction_record_fields_method3 = [ { name => 'Batch_Agency', range => [ 1 .. 3], }, { name => 'Batch_Date', range => [ 4 .. 11], }, { name => 'Batch_Type', range => [ 12 .. 12], }, ]; print $transaction_record_fields_method3->[2]{name}, "\n"; print Dumper($transaction_record_fields_method3->[2]{range});