title: Perl and Regular expression; $1 is empty
body: <p><strong>Script:</strong></p>
  <pre><code>$aString = &quot;This is Just a temp string just for fun&quot;;
  
  print '^^^^^^^^' . &quot;\n&quot;;
  
  if( $aString =~ /^This\sis.*just/ )
  {
      print $aString . &quot; -&gt;true&lt;-\n&quot; . &quot;^^^^^^^^&quot; .&quot;$1&quot;;
  }
  else
  {
      print $aString . &quot; -&gt;false&lt;-\n&quot; . &quot;^^^^^^^^&quot; .&quot;$1&quot;
  }
  </code></pre>
  <p><strong>Output:</strong></p>
  <blockquote>
  <p>^^^^^^^^</p>
  <p>This is Just a temp string just for fun -&gt;true&lt;-</p>
  <p>^^^^^^^^</p>
  </blockquote>
  <p><strong>Questions:</strong></p>
  <ol>
  <li>Why $1 is empty?</li>
  <li>How to know how much sub-expression in <code>aString</code> is matched?</li>
  </ol>
  <p>Pls clarify.</p>