Help for this page

Select Code to Download


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