A
A man
How do I count the number of delimiters in a string when split drops
any null fields at the end of a string? Example:
My string=1,2,3,,4,5,,,,
I want to count how many delimiters there are, which should be 8. But
if I do a split I get:
1
2
3
(null)
4
5
I need to count those other commas at the end. Does anyone know how
to do this?
I tried $n=$l=~m/,/ but that only returns 1 if the string exists in
$l.
any null fields at the end of a string? Example:
My string=1,2,3,,4,5,,,,
I want to count how many delimiters there are, which should be 8. But
if I do a split I get:
1
2
3
(null)
4
5
I need to count those other commas at the end. Does anyone know how
to do this?
I tried $n=$l=~m/,/ but that only returns 1 if the string exists in
$l.