#!/usr/bin/perl use strict; use warnings; my $lastline = ''; while (<>) {    if (m~ROT~ or $lastline =~ m~ROT~) {       print;    }    $lastline = $_; }