Hello,
I'm having trouble with search and replace in bioperl. I'm trying to replace one or more Ns at the beginning of each sequence in a fasta file. When I use the following code, the match works, but the search/replace line gives an error:
while ( my $seq = $in->next_seq() ) {
if($seq->seq =~ m/^(N+)/) {
print "Starts with N\n";
$seq->seq =~ s/^(N)+//;
}
Can't modify non-lvalue subroutine call at TrimN.pl line 26, <GEN0> line 1.
What am I missing?
Thanks for any help!
I'm having trouble with search and replace in bioperl. I'm trying to replace one or more Ns at the beginning of each sequence in a fasta file. When I use the following code, the match works, but the search/replace line gives an error:
while ( my $seq = $in->next_seq() ) {
if($seq->seq =~ m/^(N+)/) {
print "Starts with N\n";
$seq->seq =~ s/^(N)+//;
}
Can't modify non-lvalue subroutine call at TrimN.pl line 26, <GEN0> line 1.
What am I missing?
Thanks for any help!