in reply to Re^2: Get variables from txt file
in thread Get variables from txt file

There are several modules which will interpolate variables into strings so you needn't roll your own. See String::Interpolate