#!/usr/bin/perl use strict; use warnings; my @X = ([0,1],[0,0,0],[1,1,1,1,1,1,1,1,1]); #This is a ragged 2 D array foreach my $row_ref (@X) { print "num of elements this row: ", scalar (@$row_ref), "\n"; } __END__ num of elements this row: 2 num of elements this row: 3 num of elements this row: 9