http://qs321.pair.com?node_id=1216410


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;