while ( $line =~ / (?<= .{9} [ATCG]{10} G ) G /gsx ) { my $match = substr $line, $+[ 0 ] - 21, 21; print $KMERS '>crispr_', ++$count, "\n$match\n" unless $unique_data{ $match }++; }