No such thing as a small change | |
PerlMonks |
Re: Re: regexp word break helpby George_Sherston (Vicar) |
on May 01, 2002 at 11:42 UTC ( [id://163238]=note: print w/replies, xml ) | Need Help?? |
I really like that, partly because I don't understand quite why it works. Without the brackets $str would be set to "1", which I take to be the return value of the successful pattern matching. But why do the brackets stop this happening? I should have thought that $str and ($str) wd behave the same way. And then why do they not perform this function in ($str) = $str =~ s/(.{1,45})\b/foo/s;, in which $str gets set to "1"? /me backs respectfully away from the shrine... § George Sherston
In Section
Seekers of Perl Wisdom
|
|