in reply to Re: A Love/Hate Relationship - A Long Time Newbie's Current Block
in thread A Love/Hate Relationship - A Long Time Newbie's Current Block
First of all, you're very close-the function you may wish to look at, though, is grep(), because you can do something like print OUTPUT_A join ( ',', $fn, $ln, $id ), "\n" if ( grep( /$id/, @a ) ); with it. I can't see a really good reason for changing to hashes for the IDs at the moment.
Quite the opposite. grep performs really, really poorly if you want to do repeated searches (and that's what is happening here). On the other hand, building a hash takes a bit of overhead, but searches are really, really fast.
I can't see any reason to use grep in this case.
Abigail
|
|---|