 <p>The brackets in the search pattern make that a "group". What <code>$_ =~ /regex/</code>returns is an array of all the matching groups, so <code>my ($tmp)</code> grabs the first group into $tmp.</p>