in reply to Re^2: Infinity loop
in thread Infinity loop
updatefor my $seq ($_[0]->seq()) { # in case you need to reset the first match position # (avoid pos() on huge strings) # $seq =~ /\za/g; $CG++ while $seq =~ /CG/g; }
Interesting enough, due to the way the perl internals work, this doesn't save you memory compared to
during the processing, but the gain is less wasted memory when $seq goes out of scope again (this isn't a memory leak, perl will reuse that memory if the scope is entered again)my $seq = $_[0]->seq();
|
---|