| CGI-MxScreen documentation | view source | Contained in the CGI-MxScreen distribution. |
CGI::MxScreen::HTML - various HTML utility routines
use CGI::MxScreen::HTML;
# Colours
print p("Those are ".red("red words"));
# Extra HTML tags
print center(
p(
flash("flashing") . " and " . blink("blinking") . " centered words"
)
);
# HTML escapes
my $escaped = escape_HTML("This & that <will> show");
print "<p>$escaped</p>";
my $str = unescape_HTML($escaped);
This package holds various utility routines taken out of Tom Christiansen's
MxScreen program (a "graphical" front-end to his Magic: The Gathering
database) which greatly inspired this framework.
Those routines simply emit text within enclosing HTML tags. The following color routines are defined:
red yellow orange green blue purple violet magenta cyan
For instance:
print p(big(strong(red("WARNING:"))));
would print a big boldface (usually) WARNING: in red.
Two routines, escape_HTML() and unescape_HTML() perform basic HTML
quoting and un-quoting. By basic, I mean they only take care of
escaping (and repectively unescaping) the "&", "<" and ">" characters. The
quote character (") is also escaped as """.
Tom Christiansen <tchrist@perl.com> within his MxScreen program.
Raphael Manfredi <Raphael_Manfredi@pobox.com> for the repackaging
within the CGI::MxScreen framework.
Send bug reports, suggestions, problems or questions to Jason Purdy <Jason@Purdy.INFO>
CGI::MxScreen(3).
| CGI-MxScreen documentation | view source | Contained in the CGI-MxScreen distribution. |