Not sure if you've deliberately put in two bugs there haha
1. shift only shifts off the first element.
2. (if classify this as a bug) using $a and $b are frowned upon because they're the default variables when using sort.
Oh wow I had forgotten about default variables. Such a lovely and inscrutable idea.
Ha, (1.) was deliberate but I'd forgotten (2.)
Oh wow I had forgotten about default variables. Such a lovely and inscrutable idea.