But it's hard to believe that there isn't already an full featured unix-grep emulation in pure perl, and we are reinventing the wheel.It's called ack. And it is a reinvention of the wheel. acks usefulness doesn't come from the fact it's implemented in Perl, but because it has some features that grep doesn't have, and has some better defaults.
In the OP's case, he's better of with calling grep, then with ack. (grep is expected to be faster (as it's in C, not in Perl))
In reply to Re^3: push to an array lines matching a pattern, and the lines before and after the matching
by JavaFan
in thread push to an array lines matching a pattern, and the lines before and after the matching
by gianni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |