laziness, impatience, and hubris | |
PerlMonks |
Re: my $x or my ($x)by johngg (Canon) |
on Apr 04, 2006 at 12:47 UTC ( [id://541140]=note: print w/replies, xml ) | Need Help?? |
Another place where the effect of my $x; and my ($x); differs is in matching regular expressions. Assigning a match in scalar context just records whether the match was successful, like this
prints 1 whereas matching in list context assigns the captures in the match
prints cd Normally, or rather probably, you would be making more than one capture in the regular expression so you would do something like
Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|