Bioperl: manipulating long strings (genomes) in PERL

Ian Korf
Mon, 29 Mar 1999 13:01:16 -0600 (CST)

Is it possible you have code that does something like this?

my $seq = "";
while (<FH>) {
	$seq .= $_

If so, you may be causing reallocations as Perl keeps the scalar contiguous.
Here's an approach that should work better.

my $seq;
	my @seq = <FH>;
	chomp @seq;
	$seq = join("", @seq);

Now you only have to allocate the scalar once. The local block there is
just forcing garbage collection of @seq;

=========== Bioperl Project Mailing List Message Footer =======
Project URL:
For info about how to (un)subscribe, where messages are archived, etc: