in reply to How do I find the size of an array?

The "value" of an array variable in any scalar context is its length. E.g.
scalar(@array)
Or
$length = @array;

Replies are listed 'Best First'.
Re: Answer: How do I find the size of an array?
by Anonymous Monk on Apr 28, 2007 at 01:17 UTC
    Either of the commands should do the job: scalar(@array); $#array Shashidhar Iddamsetty
      wrong