while (@lines) { chomp; print if /\Q$pattern\E/; }