Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Chaining string ops

by roju (Friar)
on Aug 28, 2003 at 19:25 UTC ( #287496=note: print w/replies, xml ) Need Help??


in reply to Re: Chaining string ops
in thread Chaining string ops

Could we not have it both ways? After all, this is perl....

if ($s =~ s/change/me/)
and
$str = "some string" =~ s/a/b/r =~ s/foo/bar/r

where /r is the newly created "chaining" modifier that forces a /r/eturn of the new string. Make it have no side effects either (ie. not touch the original string), and it'd fill a need.

Update: changed /c to /r, seeing as /c is taken.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287496]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2023-12-08 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (33 votes). Check out past polls.

    Notices?