Problems? Is your data what you think it is? | |
PerlMonks |
sort AoH buggy?by LanX (Saint) |
on Dec 09, 2021 at 15:49 UTC ( [id://11139505]=perlquestion: print w/replies, xml ) | Need Help?? |
LanX has asked for the wisdom of the Perl Monks concerning the following question:
This is the weirdest bug and I'm totally confused. I created a buggy function but my tests miraculously passed none the less. I narrowed it down to this demo where sort is magically expanding stringified hashrefs like "HASH(0x253f0c8)" ... (see <--- WTF? in output) Could someone please explain the difference between sort AoH and sort {$a cmp $b } AoH here
OUTPUT:
Cheers Rolf
Back to
Seekers of Perl Wisdom
|
|