Talán: my ( $c1, $c2 ); while (<STDIN>) { next if $line > $.; $c2 = substr $_, $offset, 1; if ( $line == $. ) { $c1 = $c2; next; } if ( $c1 ne $c2 ) { print; last; } }