The stupid question is the question not asked | |
PerlMonks |
Re: Force access a Hash ref as Array refby tobyink (Canon) |
on Jul 20, 2021 at 06:45 UTC ( [id://11135197]=note: print w/replies, xml ) | Need Help?? |
Hashes in Perl aren't ordered. As soon as you put things in a hash, whatever order the keys and values were listed in has already gone. The workaround you describe is the best option. Passing a tied hash which maintains order is also a possibility, but results in more work for your caller, and slower performance.
In Section
Seekers of Perl Wisdom
|
|