I'm trying to write a perl script that (at the heart of it) will read an html file one character at a time and send it out via apache.
Meaning a url of:
Code:
http://www.mydomain.com/cgi-bin/read.pl?page=test.html
would read test.html (one character at a time) and send it to Apache to be displayed as a normal web page...
So far I have:
Code:
#!/usr/bin/perl
use CGI qw(:param);
my $page = param('page');
print "Content-type: text/plain; charset=iso-8859-1\n\n";
open FILE, "$page" or die $!;
while($ch = getc(FILE)) {
print $ch;
}
close (FILE);
The page is spit out the web server but, it is displayed EXACTLY (as text) and not as html (meaning the HTML code is visible).
It's late, I'm tired, any ideas?