in reply to Having a problem creating a hash with the map function
If you wanted to get fancy and cryptic, you could create your "goal" hash by:
It uses an array-slice of @{ $car_city_dealer_aoa[0] }, skipping the first (0) element, and mapping the rest.
but I would not write code like that without an explanation:my %Belfast_car_dealer_hash = map{$_=>1} @{$car_city_dealer_aoa[0]} [1..$#{$car_city_dealer_ao +a[0]}];
It uses an array-slice of @{ $car_city_dealer_aoa[0] }, skipping the first (0) element, and mapping the rest.
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest." -Confucius
In Section
Seekers of Perl Wisdom