in reply to Evaluate in a substitute

Although the "eeg" trick of Abigail-II is nice, I don't think it gives you enough flexibility. I would use a sub, like so:

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