I’m writing a Perl script that reads HTML code from a text file, evaluates $ variables in the HTML page, and then prints the page to the browser. Here’s my problem:
Let’s say my HTML page contains the variable $a and my Perl script defines $a = 1. When I print the code to the browser, Perl prints “$a” to the screen instead of evaluating the string and printing “1”.
How can I have Perl open an HTML file containing string variables, evaluate the variables and then print the HTML to the browser?