##
perl -ne"BEGIN{$C=0}$p=tell ARGV; ++$c, print if /Larry|Robb/ and not scalar <> =~ /Larry|Robb/; seek ARGV, $p, 0; exit if $c==2 " logfile
####
perl -ne"BEGIN{$C=0}$p=tell ARGV;/Larry|Robb/&<>!~/Larry|Robb/and++$c,print;seek ARGV,$p,0;$c==2&&exit" logfile