Re: Another Template Toolkit Q

2001-01-29 Thread Richard Clamp

On Mon, Jan 29, 2001 at 03:17:10PM -, [EMAIL PROTECTED] wrote:
 
 So TT nicely allows a filename, a filehandle or blank for STDOUT.
 
 So how to I capture the output to "some variable" so I could, say,
 manipulate that output
 without having to read the file I've outputted?
 
 Is that possible?

istr if you give it a scalar reference, as the 3rd parameter, then it puts
it in there.

Hang on, isn't there an actual Template Toolkit mailing list.

-- 
Richard Clamp [EMAIL PROTECTED]



Re: Another Template Toolkit Q

2001-01-29 Thread Struan Donald

* at 29/01 15:17 - [EMAIL PROTECTED] said:
 
 So TT nicely allows a filename, a filehandle or blank for STDOUT. 
 
 So how to I capture the output to "some variable" so I could, say,
 manipulate that output 
 without having to read the file I've outputted? 
 
 Is that possible? 

mmm, this should be a FAQ...

perldoc Template:

   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.

If you note, the third paramater can be a ref to a scalar to which the
output is appended.

hth

struan

(sho missed this fisrt time round too :)



RE: Another Template Toolkit Q

2001-01-29 Thread Mark . Kitching
Title: RE: Another Template Toolkit Q






Hang on, isn't there an actual Template Toolkit mailing list.

-- 
Richard Clamp [EMAIL PROTECTED]



There is? Well I know when I'm not wanted then :-)


Mark k.





RE: Another Template Toolkit Q

2001-01-29 Thread Neil Ford


Hang on, isn't there an actual Template Toolkit mailing list.

--
Richard Clamp [EMAIL PROTECTED]


There is? Well I know when I'm not wanted then :-)

Mark k.

Check http://www.tt2.org/info.html#lists for details.

And it's not that you're not wanted :-) it's more that you're likely 
to get more authorative answers there.

Neil.
-- 
Neil C. Ford
[EMAIL PROTECTED]
http://www.binky.ourshack.org



Re: Another Template Toolkit Q

2001-01-29 Thread Jonathan Stowe

On Mon, 29 Jan 2001 [EMAIL PROTECTED] wrote:


 So TT nicely allows a filename, a filehandle or blank for STDOUT.

 So how to I capture the output to "some variable" so I could, say,
 manipulate that output
 without having to read the file I've outputted?


$tt-process($template,$variables,\$outvar);

$outvar will contain the output.

/J\
-- 
Jonathan Stowe   |
http://www.gellyfish.com |   I'm with Grep on this one
http://www.tackleway.co.uk   |