There's more than one way to do things | |
PerlMonks |
Filtering array based off of two values against second arrayby Speed_Freak (Sexton) |
on Oct 26, 2017 at 04:11 UTC ( [id://1202045]=perlquestion: print w/replies, xml ) | Need Help?? |
Speed_Freak has asked for the wisdom of the Perl Monks concerning the following question: Alright, I'm working in a few hundred lines of code here that would take exponentially longer to sanitize and create data sets to provide a functional snippet....so I'm not going to. I think the question is easy enough to pose, so I'm hoping I don't get too many "follow all the rules" replies. I have two arrays. Array one is the finished product of the script.....except it has a ton of extraneous data that I don't want, and has proven incredibly hard to prevent from being entered into the array. Enter array two, my filter.
What I need to do is take Array 1 and recreate it for [ 0 ],[ 1 ],[ 2 ],[ 3 ],[ 4 ] for each entry where [ 1 ] or [ 3 ] matches any of the [ 1 ]'s in Array 2 is that straightforward enough? Sorry for the crap post, I'm on a time crunch and traveling away from my notes on this script. Brain is fried. OOOOH, and while we're at it, lets add a [ 5 ] and [ 6 ] to array 1 that stores any matching [ 0 ] from array 2 for that sub_id!
Back to
Seekers of Perl Wisdom
|
|