$ perl -MO=Deparse -e "while(<>){print if($.==2||$&&&!$s++);$.=0 if(/^-+$/)}" while (defined($_ = )) { print $_ if $. == 2 or $& and not $s++; $. = 0 if /^-+$/; } -e syntax OK