sub depth { return 0 unless ref $_[0] eq 'ARRAY'; return depth( ${$_[0]}[0] ) + 1; }