jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Output is#! /usr/bin/perl use strict; use warnings; my $n = "ABCDABDIDAOFOOFAA" ; my $d = ($n =~ /A/g) ; print "matches $d" ;
In this example I try to find out how many A's are present in the string.matches 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to count matches
by merlyn (Sage) on May 04, 2007 at 14:42 UTC | |
|
Re: how to count matches
by ferreira (Chaplain) on May 04, 2007 at 14:47 UTC | |
by Anonymous Monk on Oct 24, 2015 at 10:42 UTC | |
|
Re: how to count matches
by j1n3l0 (Friar) on May 04, 2007 at 15:26 UTC |