Robin Szemeti sent the following bits through the ether:

> how do you get the process() method to return the output to you instead of
> printing the damn thing.??? 

Obviously didn't read the bit about the process method eh?

           # text reference
           $tt->process(\$text)
               || die $tt->error(), "\n";
...
       By default, the processed template output is printed to
       STDOUT.  The process() method then returns 1 to indicate
       success.  A third parameter may be passed to the process()
       method to specify a different output location.  This value
       may be one of: a plain string indicating a filename which
       will be opened (relative to OUTPUT_PATH, if defined) and
       the output written to; a file GLOB opened ready for
       output; a reference to a scalar (e.g. a text string) to
       which output/error is appended; a reference to a
       subroutine which is called, passing the output as a
       parameter; or any object reference which implements a
       'print' method (e.g. IO::Handle, Apache::Request, etc.)
       which will be called, passing the generated output as a
       parameter.

You'd be wanting the string ref as above, matie.

Leon
-- 
Leon Brocard.............................http://www.astray.com/
yapc::Europe............................http://yapc.org/Europe/

... Don't thank me for insulting you. It was my pleasure...

Reply via email to