in reply to Fastest way to grep multiple time on some array
With a little bit of effort you can probably "fold" both conditions into one. That would be more efficient.@final_result = grep /first condition/, grep /second condition/, @orig +inal_array;
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|