HTML::Stream is a HTML output stream class, and some markup utilities.
SYNOPSIS
Here's small sample of some of the non-OO ways you can use this module:
use HTML::Stream qw(:funcs);
print html_tag('A', HREF=>$link);
print html_escape("");
And some of the OO ways as well:
use HTML::Stream;
$HTML = new HTML::Stream *STDOUT;
# The vanilla interface...
$HTML->tag('A', HREF=>"$href");
$HTML->tag('IMG', SRC=>"logo.gif", ALT=>"LOGO");
$HTML->text($copyright);
$HTML->tag('_A');
# The chocolate interface...
$HTML -> A(HREF=>"$href");
$HTML -> IMG(SRC=>"logo.gif", ALT=>"LOGO");
$HTML -> t($caption);
$HTML -> _A;
# The chocolate interface, with whipped cream...
$HTML -> A(HREF=>"$href")
-> IMG(SRC=>"logo.gif", ALT=>"LOGO")
-> t($caption)
-> _A;
# The strawberry interface...
output $HTML [A, HREF=>"$href"],
[IMG, SRC=>"logo.gif", ALT=>"LOGO"],
$caption,
[_A];
The HTML::Stream module provides you with an object-oriented (and subclassable) way of outputting HTML. Basically, you open up an "HTML stream" on an existing filehandle, and then do all of your output to the HTML stream. You can intermix HTML-stream-output and ordinary-print-output, if you like.
There's even a small built-in subclass, HTML::Stream::Latin1, which can handle Latin-1 input right out of the box. But all in good time...
Product's homepage
Requirements:
· Perl