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;
|
---|
In Section
Seekers of Perl Wisdom