in reply to Re^2: inserting HTML file in a PERL script
in thread inserting HTML file in a PERL script

yes, you could match on the $ and lookup the variable name in a hash, and replace with the value. Expects the template variables to be uppercase (A-Z and _ only) and the hash keys to be lower case.
use strict; use warnings; my %data = ( first_name => 'Foo', email => 'Bar', ); $/ = undef; my $s = <DATA>; $s =~ s/\$([A-Z_]+)/exists $data{lc $1}?$data{lc $1}:$&/esg; print $s; __DATA__ First name is $FIRST_NAME and<br> email is: $EMAIL. junk is $JUNK