## remove regex-unfriendly newline chomp( my $pat = ); open(FILE, "filename") or die("ack: $!"); while() { print if /$pat/; }