mention that $1 etc. is reset even without any /()/'s

[email protected] (Dan Jacobson)
Newsgroups perl.documentation
Message-ID <[email protected]>
perlop and perlretut seem not to mention that $1, $2 ... are reset
even when one doesn't use ()'s.

"Hello World" =~ /W(o)rld/;
print $1; #prints "o"
"Hello World" =~ /World/;
print $1; #uninitialized value!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.