 <p>"These pattern match variables are scalars and, as such, will only hold a single value. That value is whatever the capturing parentheses matched <strong>last</strong>."</p> <p><a href="http://blogs.perl.org/users/sirhc/2012/05/repeated-capturing-and-parsing.html" rel="nofollow">http://blogs.perl.org/users/sirhc/2012/05/repeated-capturing-and-parsing.html</a></p> <p>In you example, <code>$1</code> matches <code>1.2.3</code>. As the pattern repeats, <code>$2</code> would be set to <code>.2</code> until the final match of <code>.3</code></p>