in reply to Substituting Variables while reading text file

The problem is probably that you are using a bare word instead of a string. Try changing:
my $VAR = "TEMP_VAR";
and it should work. My quick test with a Perl one-liner under Unix:
$ echo 'create variable $VAR alarm_object 0' | perl -e '$VAR = "TEMP_V +AR"; while (<>) { chomp; eval (qq{print "$_\n";});}' create variable TEMP_VAR alarm_object 0
My understanding is that this is closer to what the OP wanted than s///, but I may of course be wrong.