in reply to Re: Little pattern problem...
in thread Little pattern problem...
In response to a /msg.
$target_name = $1 if m[( \d{7} ) _at: \d{3} : \d{3} ]x;
If the regex matches $_ (ie. the line read in from the DATA file), then the 7-digit number '\d{7}' is captured (because of the brackets) into the perl special variable $1. Because the regex matched, the if condition is true and so the value of $1 will be assigned to the variable $target_name.
If that isn't clear then I suggest your find and read the documents perlrequick and perlretut, particularly the sections entitled "Extracting matches" in both. You should have copies of these on your system, but the above links will take you to the latest versions incase you haven't. They won't take long to read and they do a much better job of explaining this stuff than I would.
I hope that clarifies things a little.
|
|---|