Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: can substitution operator replace text with value returned from function?

by Paladin (Vicar)
on Jun 11, 2018 at 16:56 UTC ( #1216410=note: print w/replies, xml ) Need Help??


in reply to can substitution operator replace text with value returned from function?

You can use the  /e modifier to  s/// to execute the RHS and use the return value as the substitution value.
s/__AMOUNT__/format_number($amount)/eg;

Log In?
Username:
Password:

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

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











    Results (20 votes). Check out past polls.

    Notices?