Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: perldoc of s///ee wrong or just misleading?

by ikegami (Patriarch)
on Dec 29, 2014 at 17:58 UTC ( [id://1111636]=note: print w/replies, xml ) Need Help??


in reply to perldoc of s///ee wrong or just misleading?

SubstitutionExpression evaluated for each matchIf the operator was implemented as a function
s/pat/repl/qq/repl/subst($_, qr/pat/, sub { qq/repl/ })
s/pat/repl/ereplsubst($_, qr/pat/, sub { repl })
s/pat/repl/eeeval(repl)subst($_, qr/pat/, sub { eval(repl) })

In both of the last two cases, repl is evaluated as a scalar expression and its result is expected to be a string.

The docs are incorrect or confusing.

Replies are listed 'Best First'.
Re^2: perldoc of s///ee wrong or just misleading?
by LanX (Saint) on Dec 30, 2014 at 02:58 UTC
    > repl is evaluated as a scalar expression

    Not sure, do you mean string eval?

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

      I don't understand the question — neither the whole nor any part of what I said can be replaced by "string eval" and still make sense — but I did say what I meant to say.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found