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

or, instead of a loop over all of @mainarr, you might use:

print @{$mainarr[1]};

Replies are listed 'Best First'.
Re^3: Array of array
by vinoth.ree (Monsignor) on Jun 04, 2009 at 09:16 UTC
    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
      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"; }