in reply to use of useless void in context

I think that $1 is not set outside of the s/// marks

That's correct.

$content =~ s/(\$[a-zA-Z0-9\{\'\}_]+)/ if $1(eval($1)) /ge;

That won't work. At the very least it's spelled if (...) { ... } (but I guess it won't work when an expression is expected).

That said, why do you want that if at all? evaling an empty string isn't an error, so I don't see why you want to avoid it.