in reply to substr is behaving differently with small vs large strings
Your code (and substr) works fine. I just generated a 2.6 MB test file, put START and END at the appropriate places and the results are exactly what you want.
That leaves a couple fo possibilities.
BTW. You could replace your editcontig() sub with
my $contigfile = "$contig.txt"; open(CONTIG, $contigfile) or die (">Could not open $contigfile!\n$!"); my $goodseq = <CONTIG>; $goodseq =~ tr[0-9\n ][]d; #clear giant variable to free some memory???? # $rawseq = '';
This will reduce the memory required by your program from 35 MB to around 6MB.
It will also speed it up slightly, but if that offends you, you can always add a sleep 10; :)
|
|---|