http://qs1969.pair.com?node_id=483455


in reply to Re^2: How to use regular expression for this?
in thread How to use regular expression for this?

my $result = $pattern ^ $_;
This XORs $pattern and $_ together, and stores it in $result.
my $matches = $result =~ tr/\0//;
This counts the number of matches, and puts that into $matches.

-QM
--
Quantum Mechanics: The dreams stuff is made of