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(<IT>string</IT>...)`, `push_output(<IT>type</IT>[,<IT>data</IT>])`, 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