in reply to Sort an array using the Schwartzian transform

sort { $a->[1] cmp $b->[1] } ^^^

You want <=> for numeric comparison, not cmp.