redss has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to use the return value of the function in the replace text of the s/// operator?
In other words is there a way to effectively do this:
s/__AMOUNT__/format_number($amount)/g;instead of this (which requires an extra line and variable):
$formatted_amount = format_number($amount); s/__AMOUNT__/$formatted_amount/g;
Back to
Seekers of Perl Wisdom