Re: Buffering Output

2001-07-31 Thread Stas Bekman

On Tue, 31 Jul 2001, raptor wrote:

> Anybody know if exist some module how CGI::Out for buffering output in CGI
> script ?
>
> ]- The other approach if  U don't want to append to var...then U can do
> something like this :
>
> my $buffer;
> sub xprint { $buffer .= @_ };

> possibly U will want to move this code into separate module...!!

probably it's worth explaining why:
http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret

or just use a global.

use vars qw(@buffer);
@buffer = ();  # init
sub xprint { push @buffer, @_  };
...
# flush
print @buffer;

> then use xprint instead of print... and on the end of the script just :
>
> print $buffer;
>
> I also often direct all my output like errors,debug messages etc... trought
> similar function... this aproach is also very useful 'cause if for example
> want later to switch to other envoirment u need to correct just one function
> or if U use Template system...
>
> HtH
> =
> iVAN
> [EMAIL PROTECTED]
> =
>
>



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: Buffering Output

2001-07-31 Thread raptor

Anybody know if exist some module how CGI::Out for buffering output in CGI
script ?

]- The other approach if  U don't want to append to var...then U can do
something like this :

my $buffer;
sub xprint { $buffer .= @_ };

possibly U will want to move this code into separate module...!!

then use xprint instead of print... and on the end of the script just :

print $buffer;

I also often direct all my output like errors,debug messages etc... trought
similar function... this aproach is also very useful 'cause if for example
want later to switch to other envoirment u need to correct just one function
or if U use Template system...

HtH
=
iVAN
[EMAIL PROTECTED]
=





Re: Buffering Output

2001-07-31 Thread Perrin Harkins

> Anybody know if exist some module how CGI::Out for buffering output in CGI
script ?

Is there a reason you can't just append everything to a variable until the
end?  If that won't work, you can tie STDOUT.  Apache::Filter might help.
- Perrin




Buffering Output

2001-07-31 Thread Mauricio Amorim



    Anybody know if exist some 
module how CGI::Out for buffering output in CGI script ?
 
    Thank 
you