in reply to perl script eats all my PC memory...

From the dates in the file header, this looks like a file you've inherited. Perhaps the first thing to do is write a small script that just contains this
my @satfile = <STDIN>; my @satseq = @satfile;
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 $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; } }
which is a more memory efficient way to deal with large files.

If the concatenation is still killing memory, try substr($satseq[$sorsz],length($satseq[$sorsz]),0) = $line

Sometimes I can think of 6 impossible LDAP attributes before breakfast.