RE: Re: Counting regex occurrences

2002-12-14 Thread Bill Royds -Perl
; Is the same but the first just eliminates the temporary. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adrian Brinton Sent: Sat December 14 2002 05:58 To: [EMAIL PROTECTED] Subject: Re: Re: Counting regex occurrences I found this bit of code

Re: Re: Counting regex occurrences

2002-12-14 Thread Adrian Brinton
I found this bit of code somewhere, and I've used it whenever I need to count occurrences of something. It doesn't require any extra temp variables. It works although I don't know why. Perhaps someone can explain exactly what's happening here... #count the occurrences of "a" $string = "aaabbbcccd