The page i want to open is on my server - along with all my other pages including the perl file. I am trying to modify an existing script and have got to:
#!/usr/bin/perl -w
use strict;
my $file = "/path/to/file.html";
open( FILE, $file ) or die $!;
while ( <FILE> ) {
print $_ . "\n"; # line by line
}
close(FILE);
#!/usr/bin/perl -w
use strict;
my $file = "/path/to/file.html";
print "content-type: text/html\n\n";
open( FILE, $file ) or die $!;
while ( <FILE> ) {
print $_ . "<br>"; # line by line
}
close(FILE);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.