in reply to Re^3: Array of array
in thread Array of array

Anonymous Monk asked in foreach thats why I used foreach here.

So he did, and I ignored this aspect of his request. Considering it now, I suggest the following:

foreach my $element (@{$mainarr[1]}) { print "$element\n"; }