#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Carp; my @tables = ( { "table" => "table1", "description" => "bla", "datafield" => [ { name => "field1", assoc_table => "table2", } ] }, { "table" => "table2", "description" => "blubb", "datafield" => [ { name => "field1", assoc_table => "table3", } ] }, ); my %lut = map { $_->{'table'} => $_->{'datafield'} } @tables; print Dumper \%lut;