my @array = map {int rand 1e6} 1..400000; ... $lookup_table{$_}++ for @array;