Old Russian saying: "This work is not easy, to drag a hippo from a swamp" (admittedly it loses something in translation). Your frustration is understandable. However, I think you overlook one of the important points about Perlmonks, why it is so useful.

Perlmonks is so useful because you often get so many different answers to your question. Everyone has a slightly (or hugely) different take on your question, comes up with something a bit different. Yes, there are wrong answers. People often misread the question, misunderstand the subtleties of Perl, or otherwise err. That's part of the price we all pay for having a "free" source of information - it's not 100% tested and accurate. Still, neither is Windows, and you pay for that...

Your question about the number of elements in an array *has* been answered, and abundantly so. There is a Perl idiom that returns the number of elements in an array.

Your question about the index of an element of an array is not specifically a Perl question to begin with. It arises in every language that has arrays, and it is not a trivial question. You can sort your array and speed up the searching, but in general you'll have to go look for it, no matter what language you use. Hashes are quicker but come with a price, and you might not care to pay that price.

The point is, there's no one "right" way to do most things in Perl, which is what makes it such a versatile and dynamic language. What you're complaining about - and I agree, it's very frustrating at times - is also one of the major strengths of Perl. There really is more than one way to do it, and you're likely to hear several of them each time you ask a question. In the final analysis, it's up to you to decide which answer is appropriate, if any - or to develop yet another way to do it, and maybe share that with us.


In reply to Re: “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!! by spiritway
in thread “A meeting at the Liquor-Vodka Factory”, or… same ARRAY questions again?!! by Mabooka-Mabooka

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.