note
tobyink
<blockquote><p><i>"I know that's not an ARRAY ref, but since I want to learn the appear order"</i></p></blockquote>
<p>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.</p>
<p>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.</p>
<div class="pmsig"><div class="pmsig-757127">
<small><a href="https://toby.ink/hire/">Hire me at Toby Ink Ltd</a> or <a href="https://github.com/sponsors/tobyink">Join my OnlyFans</a></small>
</div></div>
11135194
11135194