in reply to it is amazing sometimes how little you know...


another neat thing is

$ARRAY[-1]
is the same as

@ARRAY[(scalar @ARRAY) -1]
(actual code from one of my early scripts ;)