How can I quickly find the first line of a file that matches a regex?
- by lamcro
I want to search for a line in a file, using regex, inside a Perl script.
Assuming it is in a system with grep installed, is it better to:
call the external grep through an open() command
open() the file directly and use a while loop and an if ($line =~ m/regex/)?