in reply to Re: Re: Re: Perlmonk's "best pratices" in the real world
in thread Perlmonk's "best pratices" in the real world
One thing I don't like about it is that you can't write to the browser on your own, but have to return the complete output at the end of the sub. This is a major problem for one part of my application, where reports are generated from a database. The reports could get quite large--larger than I'd want to load into memory at once if I could avoid it.
You can do something like this, if you want:
sub mymode { #... print $self->_send_headers; # print your data; $self->teardown; exit( 0 ); }
This is the method suggested on the CGI::App wiki to do an "early exit."
--
"To err is human, but to really foul things up you need a computer." --Paul Ehrlich
|
|---|