my $pat = shift; while (<>) { print if /$pat/o; }