foreach $item (@array){ if(ref($item) eq 'ARRAY'){ #It's an array reference... #you can read it with $item->[1] #or dereference it uisng @newarray = @{$item} }else{ #not an array in any way... } }