Re: Usage question

Sam Tregar <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
On Sun, 5 Mar 2006, Matias Alejo Garcia wrote:

> Is there any way to, once the $template is filled, to dump the variables to
> a file?

Sure.  The full parameter set is available via param():

    my %data = map { ($_, $template->param($_) } $template->param();

You can dump that hash to a file with Storable or Data::Dumper, just
like any other Perl file.

Alterantely, you can use Storable on the HTML::Template object itself.
This is guaranteed to work since this is how HTML::Template implements
file_cache mode.

-sam


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.