Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by Paladin (Vicar)
on Jun 11, 2018 at 16:56 UTC ( [id://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 chilling in the Monastery: (5)
As of 2024-04-18 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found