The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<HTML>
<HEAD>
<TITLE>Why does sgmlspl use output instead of
print?</TITLE>
</HEAD>
<BODY>

<P><B>Links</B>: <A HREF=pushoutput.html>Next</A> <A HREF=specific.html>Previous</A> <A HREF=sgmlspl.html>Up</A> <A HREF=sgmlspl.html>Top</A></P>

<H1>Why does <A HREF=sgmlspl.html><TT>sgmlspl</TT></A> use <TT>output</TT> instead of
<TT>print</TT>?</H1>

<P><A HREF=sgmlspl.html><TT>sgmlspl</TT></A> uses a special <A HREF="http://www.metronet.com/0/perlinfo/perl5/manual/perl.html"><TT>perl5</TT></A> library <A HREF=output.html><TT>SGMLS::Output</TT></A> for
printing text.  <A HREF=output.html><TT>SGMLS::Output</TT></A> exports the subroutines
<TT>output(<IT>string</IT>...)</TT>,
<TT>push_output(<IT>type</IT>[,<IT>data</IT>])</TT>,
and <TT>pop_output</TT>.  The subroutine
<TT>output</TT> works much like the regular <A HREF="http://www.metronet.com/0/perlinfo/perl5/manual/perl.html"><TT>perl5</TT></A> function
<TT>print</TT>, except that you are not able to specify a
file handle, and you may include multiple strings as arguments.</P>

<P>When you want to write data to somewhere other than
<TT>STDOUT</TT> (the default), then you use the subroutines
<A HREF=pushoutput.html><TT>push_output</TT></A> and
<A HREF=popoutput.html><TT>pop_output</TT></A> to set
a new destination or to restore an old one.</P>

<P>You can use the <A HREF=output.html><TT>SGMLS::Output</TT></A> package in other programs by adding
the following line:</P>

<P>
<PRE>use SGMLS::Output;</PRE>
</P>

<P><B>Links</B>: <A HREF=pushoutput.html>Next</A> <A HREF=specific.html>Previous</A> <A HREF=sgmlspl.html>Up</A> <A HREF=sgmlspl.html>Top</A></P>


<ADDRESS>David Megginson <A HREF="mailto:dmeggins@aix1.uottawa.ca">&lt;dmeggins@aix1.uottawa.ca&gt;</A></ADDRESS>
</BODY>
</HTML>