in reply to MSIE Favorite Start Page
I'm ambivalent about making a reference to CGI.pm, since the script is so short and sweet. But I guess I will anyway. Handcoding HTML into scripts is a bad habit. And in this case, using CGI allows you to make program logic clearer. Plus, you can generate well-formed HTML with about half the typing, and a lot less worries about it breaking.
Apparently I'm getting downvotes for a reasonable suggestion. Here is an example of how much cleaner the code looks when you use CGI to save a static HTML file:
use CGI qw(:standard); open (FILE, ">test.html") or die "cannot open test.html: $!\n"; print FILE ( start_html( -title => "test page" ), p( "Test paragraph." ), p( "Here is a second paragraph." ), hr(), p( "This is the last." ), end_html() ); close FILE;
PS. The <center> tag has been deprecated for three years.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: MSIE Favorite Start Page
by Adam (Vicar) on Jan 12, 2001 at 22:21 UTC | |
by ichimunki (Priest) on Jan 13, 2001 at 04:34 UTC |