Skip to content

Instantly share code, notes, and snippets.

@bigpresh
Created May 28, 2010 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigpresh/417010 to your computer and use it in GitHub Desktop.
Save bigpresh/417010 to your computer and use it in GitHub Desktop.
my @matches;
my @filenames = (...);
for my $filename (@filenames) {
open(my $fh, '<', $filename) or die "Failed to open $filename - $!";
while (my $line = <$fh>) {
if ($line =~ /foo/) {
push @matches, $line;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment