sub process { my $src = shift; # possibly do some pre-processing on $src here my $value = eval $src; # possibly extra external logging if something went wrong return $@ ? "<B>Error in '$src': $@</B>" : $value; }
and then have:
$data =~ s/<# (\{.*?\}) #>/process($1)/eg;
Liz
In reply to Re: Evaluate in a substitute
by liz
in thread Evaluate in a substitute
by fightliteracy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |