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.
my ($x, $y, $z) = @shift;
Valid is either
sub () { my ($x, $y, $z) = @_;
sub ($x, $y, $z) {
my ($x, $y, $z) = @$_[0];
If $_[0] is an array reference, @$_[0] becomes a list.
The joke was a reference to most wrong Perl programs being valid for something.
Hence the meme: "93% of Paint Splatters are Valid Perl Programs"
https://www.mcmillen.dev/sigbovik/