Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- }
- }
Add Comment
Please, Sign In to add comment