- or download this
#!/usr/bin/perl
use strict;
...
Values occurring exactly twice:
B
D
- or download this
#!/usr/bin/perl
use strict;
...
my @matches = $outs =~ m|D|g;
print "exactly 2 matches for D\n" if @matches ==2;
- or download this
if ( $outs =~ tr/D// == 2) { print "exactly 2 matches for D\n" }