in reply to character-by-character in a huge file
$/ = \10000000; open (FH, "<ciona_fasta_two"); while (<FH>) { my $i = -1; while( -1 < ($i = index($_, 'x', $i+1))) { #do something; } } close FH; [download]