in reply to grepping for
I might write code something like this:
If you slurp all of the lines into an array, you could also use the grep command.my $dir = "/acm"; # open file while (<LOG>) { next unless /^\Q$dir\E/; # do something with $_ because it matches }
|
|---|