in reply to Array of arrays

An AoA is an array of scalars holding references to arrays. So assuming that you either have an AoA or a simple array, you can:

last if ref $array[0];

DWIM is Perl's answer to Gödel