in reply to while =~ consecutive matching problem
Which evaluates the match in list context, creating a list of all matches. It then assigns that in scalar context (which produces a count of the elements) to $count.my $count = () = $currentline =~ /\b$pattern\b/g;
Although, none of this will match your string of abxyxyp, because it doesn't have any spaces at all, so I suspect you mistyped that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: while =~ consecutive matching problem
by p.s (Initiate) on Nov 12, 2004 at 16:55 UTC | |
by Eimi Metamorphoumai (Deacon) on Nov 12, 2004 at 17:33 UTC |