#!/usr/bin/perl # # display the input line(s) if all patterns match # use warnings; use strict; my @patterns = @ARGV; my $pattern; LINE: while () { for $pattern (@patterns) { next LINE unless m/$pattern/i; } print; }