<div>Thank you Kent. Obviously I missed that.<br><b><br><blockquote class="xoEncapsulatedBody" style="margin-left: 5px; padding-left: 0px;">Chicago.pm chatter &lt;chicago-talk@pm.org&gt; wrote:</blockquote>
</b><blockquote class="xoEncapsulatedBody" style="border-left: 2px solid blue; margin-left: 5px; padding-left: 10px;"><div><br></div><div>On Sep 12, 2009, at 9:42 AM, Richard Reina &lt;<a href="mailto:richard@rushlogistics.com">richard@rushlogistics.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><span>I think I've got it now. I found this:</span><br><span></span><br><span>$mystring = "[2004/04/13] The date of this article.";</span><br><span>if($mystring =~ m/(\d+)/) {</span><br><span> &nbsp; &nbsp;print "The first number is $1.";</span><br><span>}</span><br><span></span><br><span>in a tutorial at <a href="http://www.somacon.com/p127.php"></a><a href="http://www.somacon.com/p127.php">http://www.somacon.com/p127.php</a></span><br><span></span><br><span>and hacked it up so that my number gets the value of</span><br><span></span><br><span>$number = $1 </span><br><span></span><br><span>and it works.</span><br><span></span><br><span>However, I am confused by the representation of the scalar $1 I have never seen that before. &nbsp;Can someone explain $1. &nbsp;Or is it something that should not be explained but instead accepted at face value?</span><br></div></blockquote><div><br></div>It says on that page, right above your example:<br><span class="Apple-style-span" style="font-family: Arial; font-size: 16px;"><p style="text-align: justify;">Prints "The first digit is 2." In order to designate a pattern for extraction, one places parenthesis around the pattern. If the pattern is matched, it is returned in the Perl special variable called $1. If there are multiple parenthesized expressions, then they will be in variables $1, $2, $3, etc.</p><div style="text-align: justify;"><br></div></span></blockquote></div>