in reply to expanding scalar content

I'm not sure I understand what you want, this is my guess as to what you want (it's what happened when I ran the code):

$HTMLLine has the literal $someVar, and you want to replace it with the value of the variable $someVar.

If that is correct, just try this:

$HTMLLine =~ s/(\$\S+)/$1/gee;
It's not perfect, but it should do unless you have a lot of variables used like this:  ${varName}some other stuff in the string. But, it will work for things like this  $var this that and ${VAR} the @other

The 15 year old, freshman programmer,
Stephen Rawls