in reply to Having a problem creating a hash with the map function
Well, the contents of your map block indicate that you don't understand map much. It needs to return something (but cannot use the return keyword!). You have the for loop as the last statement in the block, which returns undef.
# Try something like... # %hashmap = map { my ($city, @dealers) = @$_; $city => {map { $_ => 1 } @dealers}; } @car_city_dealer_aoa; print Dumper(\%hashmap);
|
|---|