#!/usr/bin/perl # find "From " lines that aren't preceded by two newlines. $pat = "^From .* (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) .* [0-9][0-9]:[0-9][0-9]"; foreach $file (@ARGV) { $len = 0; $k = 0; next unless -f $file; open (F, "$file") || die "$file: !$\n"; while () { chomp; $k++ if $len > 0 && /$pat/o; $len = length ($_); } close (F); print "$file\n" if $k > 0; } exit (0);