I think that $1 is not set outside of the s/// marks, so will this work:$content =~ s/(\$[a-zA-Z0-9\{\'\}_]+)/ eval($1) /ge if $1;
I am looking to replace merge fields within a database record.$content =~ s/(\$[a-zA-Z0-9\{\'\}_]+)/ if $1(eval($1)) /ge;
In reply to use of useless void in context by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |