use warnings; use strict; my $VAR = 'TEMP_VAR'; while () { s/\$VAR\b/$VAR/g; print; } __DATA__ create variable $VAR alarm_object 0