Links: Next Previous Up Top

Why does sgmlspl use output instead of print?

sgmlspl uses a special perl5 library SGMLS::Output for printing text. SGMLS::Output exports the subroutines output(string...), push_output(type[,data]), and pop_output. The subroutine output works much like the regular perl5 function print, except that you are not able to specify a file handle, and you may include multiple strings as arguments.

When you want to write data to somewhere other than STDOUT (the default), then you use the subroutines push_output and pop_output to set a new destination or to restore an old one.

You can use the SGMLS::Output package in other programs by adding the following line:

use SGMLS::Output;

Links: Next Previous Up Top

David Megginson <dmeggins@aix1.uottawa.ca>