Really simple question but the =()= operator (or operators) lets me count the matches in regex. What is this operator called and what exactly is it doing?
Example usage:
my $count_quotes =()= $csv_line =~ /\"/gi;
Thanks
Really simple question but the =()= operator (or operators) lets me count the matches in regex. What is this operator called and what exactly is it doing?
Example usage:
my $count_quotes =()= $csv_line =~ /\"/gi;
Thanks
FWIW, you could count the number of quotes with the tr///
operator as well:
my $count = $csv_line =~ tr/"/"/;