Just another Perl shrine | |
PerlMonks |
Re: Re: Re: Re: assigning flat file dbs to arraysby jarich (Curate) |
on Apr 29, 2004 at 03:22 UTC ( [id://349004]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|