Help for this page

Select Code to Download


  1. or download this
    my @matches;
    ....
    ...
        my $repetition = @matches;
        print "$string was encountered $repetition times.\n" if($repetitio
    +n > 0); 
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
    my @matches = $text =~ m/$string/g;
    my $count = @matches;
    print $count;