in reply to pop sort strangeness

You could pop from an anonymous array like this, my $max = pop @{[sort @vals]}; where the cast turns sort's list into a nameless array. It's much better to say,

use List::Util qw(max); my $max = max @vals;
There is a lot of lost motion in that unnecessary sort.

After Compline,
Zaxo