in reply to perl script eats all my PC memory...
and see if it runs out of memory. If so, your datafiles are too big to read in and make a copy and you'll want to deal with one line at a time, e.g.my @satfile = <STDIN>; my @satseq = @satfile;
which is a more memory efficient way to deal with large files.my $sorsz = 3; while (my $line = <STDIN>) { chomp $line; # to remove newlines if ( $. <= 3 ) { # input line numbers start from 1 push @satseq, $line; } elsif ( $line =~ /\#/ ) { $satseq[$sorsz] .= $line; # concatenates line onto the end $sorsz++; } else{ $satseq[$sorsz] .= $line; } }
If the concatenation is still killing memory, try substr($satseq[$sorsz],length($satseq[$sorsz]),0) = $line
|
---|