The stupid question is the question not asked | |
PerlMonks |
Re: Multidimensional Hash losts entrysby choroba (Cardinal) |
on Aug 13, 2014 at 13:26 UTC ( [id://1097283]=note: print w/replies, xml ) | Need Help?? |
You're overwriting the hash in every iteration. You can assign to a hash slice, fortunately:
It's not clear what exactly you want to assign, though. Does the following work for you?
Update: Note that I populate the hash only if all the attributes are defined. In your case, the @arr_X arrays were global, so the hash was repopulated again with the old values. (I use strict and warnings, why don't you?) The map expression might look a bit complex for an untrained eye. It just picks one element from b and c for each element of a.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom
|
|