Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Learning Template Toolkit Module

by trwww (Priest)
on Mar 10, 2010 at 22:30 UTC ( #827911=note: print w/replies, xml ) Need Help??


in reply to Re^2: Learning Template Toolkit Module
in thread Learning Template Toolkit Module

Yea, I've been digging through the documentation on the site, but so far it's not all that helpful. Great on making the templates work, but not so much for getting it to go to a file instead of STDOUT. Either that or I'm missing it.

Its definitely all there:

Documentation for the ->process method

Quoted here:

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://827911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2019-03-26 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (125 votes). Check out past polls.

    Notices?