part of me wants to vote this question down. let me explain, i have absolutely no problems with people asking what might be termed "newbie" questions. however, let's analyze this one, this question could have been self answered by looking at man perldata and quickly scanning it we find:
       
If you evaluate a named array in a scalar context, it
returns the length of the array.  (Note that this is not
true of lists, which return the last value, like the C
comma operator, nor of built-in functions, which return
whatever they feel like returning.)  The following is
always true:

           scalar(@whatever) == $#whatever - $[ + 1;
(stuff deleted) 
So in general you can assume that

           scalar(@whatever) == $#whatever + 1;

Some programmers choose to use an explicit conversion so
nothing's left to doubt:

           $element_count = scalar(@whatever);

which is about as definitive an answer as you are going to get! maybe this is the "angry old man" in me coming out, but it kind of ticks me off when it feels like maybe someone didn't research things enough before posting a question... oh well... i won't vote this one down, but i really hope that perlmonks doesn't start getting flooded (like the MySQL mailing list and most other good tech forums that exist) with questions that could have been easilly solved by a quick scan through some documentation...

In reply to Re: Finding the total number of elements in an array. by eduardo
in thread Finding the total number of elements in an array. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.