Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Having a problem creating a hash with the map function

by NetWallah (Abbot)
on Nov 29, 2012 at 21:47 UTC ( #1006363=note: print w/replies, xml ) Need Help??


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:
my %Belfast_car_dealer_hash = map{$_=>1} @{$car_city_dealer_aoa[0]} [1..$#{$car_city_dealer_ao +a[0]}];
but I would not write code like that without an explanation:
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006363]
help
Chatterbox?
[zentara]: TGIF, I'm blowing my mind watching Casimir Effect & Black Holes - Sixty Symbols I love 60 Symbols. :-)
zentara ..oO the vacuum is teeming with photons and micro-blackholes
zentara .. and probably NSA bugs ;-)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-06-23 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (552 votes). Check out past polls.