SGMLS::Output (3)
Leading comments
Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) Standard preamble: ========================================================================
NAME
SGMLS::Output - Stack-based Output ProceduresSYNOPSIS
use SGMLS::Output;
To print a string to the current output destination:
output($data);
To push a new output level to the filehandle
push_output('handle',DATA);
To push a new output level to the file ``foo.data'' (which will be opened and closed automatically):
push_output('file','foo.data');
To push a new output level to a pipe to the shell command ``sort'':
push_output('pipe','sort');
To push a new output level appending to the file ``foo.data'':
push_output('append','foo.data');
To push a new output level to an empty string:
push_output('string');
To push a new output level appending to the string ``David is '':
push_output('string',"David is ");
To push a new output level to The Great Beyond:
push_output('nul');
To revert to the previous output level:
pop_output();
To revert to the previous output level, returning the contents of an output string:
$data = pop_output();
DESCRIPTION
This library allows redirectable, stack-based output to files, pipes, handles, strings, or nul. It is especially useful for packages likeExample:
sgmls('<title>', sub{ push_output('string'); }); sgmls('</title>', sub{ $title = pop_output(); });
In between, anything sent to output (such as
Example:
sgmls('<tei.header>', sub { push_output('nul'); }); sgmls('</tei.header>', sub { pop_output(); });
All output will be ignored until the header has finished.