#!/usr/bin/perl

# how many times have you written something like "grep foo1 file1 | grep -E 'foo2|foo3' | grep -i foo4" ?

# multigrep: grep lines matching a list of regexes, case insensitively
# Usage: command | multigrep regex1 regex2 ...

line: while(my $line = <STDIN>){
	for my $arg (@ARGV){
		if($line !~ /$arg/i){ next line; }
	}
	print $line;
}