Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: regexp word break help

by buckaduck (Chaplain)
on May 01, 2002 at 08:39 UTC ( [id://163250]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: regexp word break help
in thread regexp word break 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://163250]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.