Here is an SSCCE which matches your spec. Enjoy.
#!/usr/bin/env perl use strict; use warnings; use Test::More; my @hant = ('Gloin1'); my @counts = (2); plan tests => scalar @hant; my $nrt2 = <<EOT; >Gloin1_46659 MVKLFARPLPIDP.... >Gloin1_30454 MIKLFDKPSKELS.... EOT for my $pat (@hant) { my $matches = () = $nrt2 =~ /$pat/g; is ($matches, shift @counts, "Correct number of matches found for +$pat"); }
In reply to Re^3: Counting matches
by hippo
in thread Counting matches
by Nicpetbio23!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |