Is there a more efficient way? @some_array can be very very large file. So first creating such a big array and then parsing it so many times looks inefficient. Moreover this will spoil the order. I want to find all lines which match the list of regexps.open file @some_array = <file> foreach $pattern (@matcharray) { grep {/$pattern/}@some_array }
In reply to Usage of grep on a file by tsk1979
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |