summaryrefslogtreecommitdiffstats
path: root/mpgrep
blob: 51a0d141771d2390db2477c64e1dad528a37d793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
#
# display the input line(s) if all patterns match
#
use warnings;
use strict;

my @patterns = @ARGV;

my $pattern;

LINE: while (<STDIN>) {
	for $pattern (@patterns) {
		next LINE unless m/$pattern/;
	}
	print;
}