in reply to last index of array ref...

That's the cardinal rule of references; wherever you'd have an array name (sans sigil), you can have $simple_scalar_holding_arrayref or {expression yielding arrayref}.