Update: Aside from changing foreach to for and using $_ in the loop, it seems i did use the for loop. having made those changes and being resistent to using a hash for a simple list of numbers, is there anything else I'm missing? -- aside from massive amount of skills and the sheer power of having memorized the docs ; )

OK, should always go with my instincts when i feel I shouldn't post. : )

Two things I should have mentioned are that 1. I really wanted this to be tucked away in a sub which returns true or false and could be passed any number of dif. args, as in the example and 2. The arrays are coming from simple lists of numbers, just like the example array - so a hash seemed to be overkill.

many good suggestions in these replies - be benchmarking for now.

-- I'm a solipsist, and so is everyone else. (think about it)


In reply to (more specific) Re: better way to find list members? by jptxs
in thread better way to find list members? by jptxs

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.