in reply to Variable expansion in $_

One other way to do it would be the following

$example = "This is an example"; while(<DATA>) { chomp; s/^\$//; print $$_; } __DATA__ $example

Of course, when using the method, it would be even simpler if your file contained variable names without the '$', allowing to remove the substitution code line.

HTH

-- zejames