Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. my @matches;
  2. my @filenames = (...);
  3.  
  4. for my $filename (@filenames) {
  5. open(my $fh, '<', $filename) or die "Failed to open $filename - $!";
  6. while (my $line = <$fh>) {
  7. if ($line =~ /foo/) {
  8. push @matches, $line;
  9. }
  10. }
  11. }
Add Comment
Please, Sign In to add comment