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

using foreach?

Yes, We can directly access the array element as you said, but Anonymous Monk asked in foreach thats why I used foreach here.

Vinoth,G

Replies are listed 'Best First'.
Re^4: Array of array
by ig (Vicar) on Jun 04, 2009 at 10:08 UTC
    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"; }