CGI::Wrap - buffer output when building CGI programs
use CGI; use CGI::Croak; use CGI::Wrap; $query = new CGI; savequery $query; # to reconstruct input $CGI::Out::mailto = 'fred'; # override default of $< run \&myfunc, @myargs # a function run sub { code } # an inline function run 'code' # something to eval sub myfunc { out $query->header(); out $query->start_html( -title=>'A test', -author=>'muir@idiom.com'); } $CGI::Out::out # is the buffer
This is a helper routine for building CGI programs. It buffers stdout until you're completed building your output. If you should get an error before you are finished, then it will display a nice error message (in HTML), log the error, and send email about the problem.
To use it, you must condense your program down to a single function call and then use CGI::Wrap::run to call it.
Instead of print, use out.
out
David Muir Sharnoff <muir@idiom.com>
Carp, CGI::Carp, CGI::Out, CGI
No support for formats is provided by CGI::Wrap.
format
To install CGI::Out, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Out
CPAN shell
perl -MCPAN -e shell install CGI::Out
For more information on module installation, please visit the detailed CPAN module installation guide.