length > 9 : only if the length of the line is more than 9 (to accommodate the newline character as well) && $last && print "$last$_"; : ...and if we have seen a line before, display that last line (<0000x\n) and the current line. $last = $_ : keep track of the last line read.