note
dakkar
<p>Parenthesised matches always end up in the match variables <tt>$1, $2, ...</tt>, so you could write:
<code>
while (<CONFIG_FILE>) {
if (/^frz\s+=\s+(\w+);/) {$bar=$1}
}
</code>
</p>
<p>If you have more than one pair of parenthesis, <tt>$1</tt> will refer to the match of the first pair, <tt>$2</tt> to the second and so on. The pairs are ordered from left to right, counting their opening parenthesis, so:
<code>
"abc123def"=~/([a-z]+(\d+)(.*))/;
print "first: $1\nsecond: $2\nthird: $3\n";
</code>
would print:
<pre>
first: abc123def
second: 123
third: def
</pre>
</p>
<pre>--
dakkar - Mobilis in mobile
</pre>
246638
246638