title: Perl regex variable for replacement count
body: <p>For a simple use case as this one</p>
  
  <pre><code>#!/usr/bin/perl
  my $text = "A choice between ASCII and UTF8 is simple";
  $text =~ s/[[:upper:]]+/?/g;
  </code></pre>
  
  <p>I need to determine if a replacement was made or not. I am hoping to find a built in variable which would tell me that. It seems like there are lot's of variables available related to regex (e.g. $1, ... $', $&amp;, @+, @- etc) but I haven't find one that can simply tell me whether a replacement was made or not or number of replacements made etc.</p>
  
  <p>Sure I can save the original string and compare with the result though if this statistics is already available in one way or another I'd use it.</p>