title: In Perl, how many groups are in the matched regex?
body: <p>I would like to tell the difference between a number <code>1</code> and string <code>'1'</code>.</p>
  
  <p>The reason that I want to do this is because I want to determine the number of capturing parentheses in a regular expression after a successful match. According the perlop doc, a list (1) is returned when there are no capturing groups in the pattern. So if I get a successful match and a list (1) then I cannot tell if the pattern has no parens or it has one paren and it matched a '1'. I can resolve that ambiguity if there is a difference between number <code>1</code> and string <code>'1'</code>.</p>