Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Re: Re: regexp word break helpby buckaduck (Chaplain) |
on May 01, 2002 at 12:39 UTC ( [id://163250]=note: print w/replies, xml ) | Need Help?? |
I should have thought that $str and ($str) wd behave the same way. This node explains the difference between list context and scalar context very well. Many of the replies have great links to some interesting articles on the subject.
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"? The perlop manpage explains the return values of the m/// and s/// operators in list and scalar context. The s/// operator returns the number of substitutions in either context. buckaduck
In Section
Seekers of Perl Wisdom
|
|