Revized edition:
Seems in my initial frustration with accomplishing such a simple task. I ultimately overcomplicated matters. :(
I think the following get's it right:
pageblocks.pm
use strict;
package pageblocks;
sub xmlheader {
qq(<?xml version="1.0" encoding="UTF-8"?>\n);
}
sub xmldtd {
qq(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:
+//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; ch
+arset=utf-8" />\n);
}
1; # polygraph
and index.cgi
#!/usr/bin/perl -wT
# index.cgi
print "content-type:text/html; charset=utf-8\n\n";
use strict;
use lib ('./');
use pageblocks;
print pageblocks::xmlheader();
print pageblocks::xmldtd();
print "<body>
...
</body></html>";
A big thanks to GrandFather, Jenda, and Anonymous Monk, for their thoughtful feedback.
--Chris
#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|