 <p>The <code>m//</code> and <code>print</code> commands are separate commands joined by an <code>&amp;&amp;</code>.</p> <p>Within a regex <code>\2</code> is a backreference to the second capture, which will be assigned to the <code>$2</code> variable after the regex has finished matching. Outside the regex <code>\2</code> is meaningless; only <code>$2</code> is a variable that can be accessed. See here for more info: <a href="http://perldoc.perl.org/perlretut.html#Backreferences" rel="nofollow">http://perldoc.perl.org/perlretut.html#Backreferences</a></p> <p>When reading that link, note that after Perl 5.10 <code>\2</code> is still recognized but <code>\g2</code> is encouraged. This is because <code>\11</code> is ambiguous.</p>