I don't get it. Can you please switch your output to verbose mode for the Perl-underprivileged?
It looks as if the counts in the evaluation of the regex work fine but somehow the result does not get transferred to the external variables ... not sure what this tells me, though.