in reply to Printing a Html Page

In your first example, you test that open succeeded with a die, but you did not do that in your second example. Add or die $! and see what happens. Also, you can replace the while loop with the succinct:
my $pageht = do {local $/;<HTMLP>};
and don't forget to use strict and warnings. You might want to also make sure that material_office.html is readable by the webserver (chmod 644).

Update - ahh good catch dimmesdale! Yes, you cannot open a file like that:

$locat = "www.nsn.org/elghome/material_office2.htm";
If this file is on the same server as your script, open it directly, and do you mean .htm or html?
my $locat = '/path/to/htdocs/elghome/material_office2.htm'; open FILE, $locat or die "can't read $locat: $!";
If this file is on another server, use LWP.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Printing a Html Page
by Anonymous Monk on Jul 23, 2002 at 19:14 UTC
    Actually, It wouldn't work until I took out the die. I originally had it in, I am also using the CGI qw(html3: and standard:) I have two files both the saem, but for testing purposes I named a new one, and also took out some html code, the form tags. I think it is on the same server, but I will try strict, but I'm not sure about it because I'm using it in a script that has over 40 variables in it. Joe