title: Perl - backreference not available when capture group is followed by?
body: <p>When a capture group is followed by a question mark, the backreference appears to be unavailable</p>
  
  <pre><code>my $test = "this is a very long day indeed";
  
  if ($test =~ m/^this.+(very).+(indeed)?/) {
    print "It matched the regex.\n";
    print "$1 :: $2\n";
  }
  </code></pre>
  
  <p>This prints</p>
  
  <pre><code>It matched the first test.
  very :: 
  </code></pre>
  
  <p>Is this normal behaviour? I can't find mention of it in any documentation. I'm trying to match lines in a log file where the second capture group may or may not exist.</p>