use DBI; my %location = map { $_->[0] => $_->[1] } @{$dbh->selectall_arrayref('select id, location from ndmw_location')};