| 1 | <HTML> |
| 2 | <HEAD> |
| 3 | <TITLE>Why does sgmlspl use output instead of |
| 4 | print?</TITLE> |
| 5 | </HEAD> |
| 6 | <BODY> |
| 7 | |
| 8 | <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> |
| 9 | |
| 10 | <H1>Why does <A HREF=sgmlspl.html><TT>sgmlspl</TT></A> use <TT>output</TT> instead of |
| 11 | <TT>print</TT>?</H1> |
| 12 | |
| 13 | <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 |
| 14 | printing text. <A HREF=output.html><TT>SGMLS::Output</TT></A> exports the subroutines |
| 15 | <TT>output(<IT>string</IT>...)</TT>, |
| 16 | <TT>push_output(<IT>type</IT>[,<IT>data</IT>])</TT>, |
| 17 | and <TT>pop_output</TT>. The subroutine |
| 18 | <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 |
| 19 | <TT>print</TT>, except that you are not able to specify a |
| 20 | file handle, and you may include multiple strings as arguments.</P> |
| 21 | |
| 22 | <P>When you want to write data to somewhere other than |
| 23 | <TT>STDOUT</TT> (the default), then you use the subroutines |
| 24 | <A HREF=pushoutput.html><TT>push_output</TT></A> and |
| 25 | <A HREF=popoutput.html><TT>pop_output</TT></A> to set |
| 26 | a new destination or to restore an old one.</P> |
| 27 | |
| 28 | <P>You can use the <A HREF=output.html><TT>SGMLS::Output</TT></A> package in other programs by adding |
| 29 | the following line:</P> |
| 30 | |
| 31 | <P> |
| 32 | <PRE>use SGMLS::Output;</PRE> |
| 33 | </P> |
| 34 | |
| 35 | <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> |
| 36 | |
| 37 | |
| 38 | <ADDRESS>David Megginson <A HREF="mailto:[email protected]"><[email protected]></A></ADDRESS> |
| 39 | </BODY> |
| 40 | </HTML> |