Hi Monks,

I've been working on a script that will print out the tags and meta tags I would usually write in a xhtml page before I begin to write out the page's content.

I would appreciate your comments/criticism on the script.

Thanks for your time

The script:

#!/usr/bin/perl -w # Program: ~/bin/newxhtmlpage # Syntax: newxhtmlpage [> yourpagename.html] # Modules: use strict; page_specs (); page_head (); page_body (); sub page_specs { # The document's specifications # Variables: my $xml_version; # xml version my $encoding; # encoding to use $encoding="iso-8859-1"; $xml_version="1.0"; print <<XHTMLSPECS; <?xml version="$xml_version" encoding="$encoding"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> XHTMLSPECS } sub page_head { # The head area of the web page # Variables: my $pagetitle; # page's title my $author; # author's name my $copyright_holder; # the copyright holder my $chartset; # character set # Does $chartset have to be the same as # $encoding in page_specs? my $default_keywords; my $default_description; # Variable defaults: $pagetitle="PUT-YOUR-TITLE-HERE"; $author="mynamehere"; $copyright_holder=$author; $chartset="iso-8859-1"; $default_keywords=""; $default_description=""; print <<XHTMLHEAD; <head> <meta http-equiv="Content-Type" content="text/html; chartset=$chartset" /> <meta name="author" content="$author" /> <meta name="copyright" content="$copyright_holder" /> <meta name="keywords" content="$default_keywords" /> <meta name="description" content="$default_description" /> <title>$pagetitle</title> </head> XHTMLHEAD } sub page_body { # The body area and closing tag print <<XHTMLBODY; <body> </body> </html> } # End
Edit kudra, 2002-04-16 Added readmore


In reply to Making a 'blank' xhtml page - request for comments by func

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.