in reply to IT's not counting...
You say that you are trying to count parentheses but you are using the patterns /'\('\d+/ and /'\)'\d+/ which count the string consisting of a parenthesis surrounded by single quotes followed by one or more numerical digits.
If you just want to count parentheses then use:
my $l_count = $testString =~ tr/(//; my $r_count = $testString =~ tr/)//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IT's not counting...
by mjscott2702 (Pilgrim) on Nov 16, 2010 at 08:46 UTC | |
by johngg (Canon) on Nov 16, 2010 at 15:30 UTC | |
by jwkrahn (Abbot) on Nov 16, 2010 at 15:12 UTC | |
by Dwood (Acolyte) on Nov 16, 2010 at 08:59 UTC | |
by JavaFan (Canon) on Nov 16, 2010 at 11:05 UTC |