Instead of substitution or matching you could use tr.
$ perl -Mstrict -Mwarnings -E ' open my $fastaFH, q{<}, \ <<EOF or die $!; > Seq 1 CTGTCA GTCCTC > Seq 2 GGCTA > Seq 3 CATGAG ATTCG EOF my $seqCt = 0; $seqCt += tr{>}{} while <$fastaFH>; say $seqCt;' 3 $
I hope this is of interest.
Cheers,
JohnGG
In reply to Re: Counting no of '>' symbol in a file
by johngg
in thread Counting no of '>' symbol in a file
by GSperlbio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |