$c = () = $a =~ /\./g
That counts the number of the characters '.' in the $a string.
A more efficient way to do that is:
$c = $a =~ tr/.//
But note that while the first verion will work with strings of any length the second verion will only work with characters.
In reply to Re: Syntax Perl Version support $c = () = $a =~ /\./g
by jwkrahn
in thread Syntax Perl Version support $c = () = $a =~ /\./g
by h2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |