my %hash; $hash{$_->[0]} = $_ for @$array_ref; #or my %hash = map{$_->[0] => $_} @$array_ref;