> [% Dumper.dump_html( data ) %]
Ah, I never noticed that dump_html method. Sounds like that will do the trick.
Thanks for your help Dave.
jamie
Dave Cash wrote:
On Thu, 2 Sep 2004, Jamie Echlin wrote:
Someone else has also suggested that - it doesn;t actually seem to work but I'm assuming it's because there is some hidden USE Dumper that I haven't found, and it does work.
Jamie,
OK, sorry for the poorly researched reply. How about this?
[% USE Dumper( Indent=0 ) %]
then later in your HTML:
[% Dumper.dump_html( data ) %]
and somewhere in your plain text:
[% Dumper.dump( data ) %]
The difference between dump and dump_html is just the addition of these transformations in dump_html:
s/&/&/g; s/</</g; s/>/>/g; s/\n/<br>\n/g;
Which all seem like things you would want to happen when dumping to a browser.
BTW, it seems like the reason my previous suggestion doesn't work is because setting the Indent and Pad via the constructor seem to be setting the correlating $Data::Dumper::Indent and $Data::Dumper::Pad values globally, which will affect ever Template::Plugin::Dumper object. I imagine that's one of the reasons why the author created a dump_html method.
Hope that helps,
Dave
/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\ Dave Cash Power to the People! Frolicking in Fields of Garlic Right On-Line! [EMAIL PROTECTED] Dig it all.
_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates
