Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^5: Creating HTML page

by cbrandtbuffalo (Deacon)
on Aug 05, 2008 at 12:16 UTC ( [id://702338]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Creating HTML page
in thread Creating HTML page

Update:Since you are just creating a flat HTML file and not streaming this to the browser via CGI, you don't need a header at all. So you can just remove the bits printing the 'Content-Type'. Printing out the header is only needed if you are generating a dynamic page.

You need to print that header into the file as well. As it is, the header is just going to the terminal so it doesn't get saved in the top of the file. Try this:
#!/usr/bin/perl use strict; use warnings; my $outname = "/usr/anil/scripts/myhtml.html"; open HTML, '>', $outname or die "Couldn't create '$outname': $!"; print HTML "<html>\n"; print HTML "<head>\n"; print HTML "<title>My Home Page</title>"; print HTML "</head>\n"; print HTML "<body bgcolor = blue>\n"; print HTML " <p>Here we have an HTML page with a paragraph.</p> "; print HTML "</body>\n"; print HTML "</html>\n"; close (HTML);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://702338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-26 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found