To be honest, I'm not quite sure what you're asking here. So I'm going to take a wild stab in the dark. You say the 2 arrays populate both includes showing the same search results.. I'm not sure what you mean by both includes and I don't know if you've added any code to the section where I wrote do something with search results.

If you have, you should show me the relevant code.

What the code I've provided you with does is the following. For each element in @sidx, copy that element into $line and REMOVE an element from @sidx2 which is put into $premiumline. Note that this means that @sidx2 will be EMPTY at the end of the foreach loop. (To avoid this make a copy of @sidx2 before the foreach loop and unshift off that instead.)

Once we've got $line and $premiumline we join them together into $sline. We then test if $sline matches what we're looking for in either $line or $premiumline and if it does we SAVE (only) $line into $resultline ($premiumline then gets thrown away).

Maybe this isn't what you want to be doing. Maybe you want to be doing this:

Maybe you're trying to do something else...

Since you haven't specified what you want to be doing I think it would be futile for me to guess. Think about what you want to do in a broader sense and I'll be able to help you better.

All the best,

jarich


In reply to Re: Re: Re: Re: assigning flat file dbs to arrays by jarich
in thread assigning flat file dbs to arrays by Dente

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.