--- [EMAIL PROTECTED] wrote:
> hello,
> i am trying to print out some html in my script and IE and Opera both
> display the html properly, however netscape will actually display the html
> as if it were a text doc. i would assume that something would be incorrect
> in my content-type, but i just don't see it.
>
> thanks -charles
>
> #!/usr/bin/perl
>
> &beginhtml;
> &mainbody;
> &endhtml;
>
> sub beginhtml {
> print <<begin_html;
> Content-type: text/html\n\n
> <html>\n
> <head><title>Control Panel</title></head>\n
> <body bgcolor=white>\n
> begin_html
> }
>
> sub endhtml {
> print <<end_html;
> </body>
> </html>
> end_html
> }
>
> sub mainbody {
> print <<main_body;
> Hello World
> mainbody
> }
Did you reproduce the code snippet accurately? As it is, it shouldn't run. Your sub
main body
has different start and end tags for the Here doc: "main_body" and "mainbody". Until
you fix
that, it won't even compile. Otherwise, if you could reproduce the exact code, that
would help.
However, have you considered using CGI.pm's HTML generating functions? The above code
is MUCH
short that way:
#!/usr/bin/perl -wT
use strict;
use CGI qw/:standard/;
print header,
start_html( -title => "Control Panel",
-bgcolor => "white" ),
"Hello World",
end_html;
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/