Re: regex, number of matches
- From: "John W. Krahn" <someone@xxxxxxxxxxx>
- Date: Fri, 23 Sep 2005 19:04:19 GMT
Dr.Ruud wrote:
>
> What I found hard to get, is the role of the '()' in the wc-words-line:
>
> $ret[1] += () = /\S+/g; # words
>
> After a while, I understood it as an anonymous array that is filled with
> the matches, after which its length is used to increase the words-count.
If it had been an anonymous array it would have been:
$ret[1] += @{[ /\S+/g ]}; # words
John
--
use Perl;
program
fulfillment
.
- References:
- regex, number of matches
- From: Dr.Ruud
- regex, number of matches
- Prev by Date: Re: find similar characters in strings?
- Next by Date: Re: HI help with perl
- Previous by thread: Re: regex, number of matches
- Next by thread: Re: Problem with Name of Excel Chart
- Index(es):
Relevant Pages
|