This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: Re: Overriding print in cgi scripts From: =?iso-8859-1?Q?Yann_Kerherv=E9?= <yk@cyberion.net> Date: Mon, 31 Jul 2000 03:05:02 +0200 On Sat, Jul 29, 2000 at 03:26:02PM -0700, Chetan Patil wrote: > Hello, > We have a large code base printing header, body and footers to the STDOUT > from the cgi scripts. Since all these are print statements, we have to go to > extreme measures to make sure we donot print the content more than once. > To clean things up (or at least start at it), we want to be able to trap the > output of print to a local buffer and then selectively flush or junk based > on the logic (for eg, if we decide to redirect at the end of the script, > then we want to junk the buffer). > I am looking for a quick solution which would allow me to override the > CORE::print function and simply write to a buffer (a perl scalar). Once I am > done with the processing, I can write out the buffer or junk it. > Is it possible to do this? What should I be careful of? > Perhaps Apache::Filter do the job ? ===