title: $1 not containing a value
body: <p>I’m writing a script that uses regexes to identify and pull out sets of years in various different formats from a text file. Here’s the bit of code in question:</p>
  
  <pre><code>if ($parts[0] =~ /^\(*(\d\d\d\d)\)*$/) {
      # Matches a single 4 digit date in parentheses such as (1979)
      $start = $1;
      $end = $1;
  } 
  elsif ($parts[0] =~ m{\d\d\d\d\/\d\d\d\d} ) {
      # Matches cases like 1948/1972
      warn "Found a $1";
      #do some other stuff
  }
  </code></pre>
  
  <p>The problem I’m encountering is that it finds dates matching the expression in the <code>elsif</code>, but <code>$1</code> doesn’t hold the value, <em>i.e.</em>, it prints out a <code>"Found a "</code> message over and over, but with no value for <code>$1</code>. Could anyone enlighten me on what I am doing wrong here? I apologize if it’s a stupid mistake.</p>
  
  <p>Thanks!</p>