Re: [Templates] correct usage of Dumper plugin

[prev] [thread] [next] [Date index for 2004/09/02]

From: Jamie Echlin
Subject: Re: [Templates] correct usage of Dumper plugin
Date: 16:39 on 02 Sep 2004
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.

So thanks for that,
jamie

Dave Cash wrote:

> On Thu, 2 Sep 2004, Jamie Echlin wrote:
> 
> 
>>I am having a small but irritating issue with the Data::Dumper plugin.
>>
>>I am using TT in a mod_perl environment, templates are processed by perl
>>handlers.
>>
>>Within my templates I am in the habit of doing:
>>
>>USE Dumper(Indent=1, Pad="<br>");
>>Dumper.dump ...
>>
>>The problem is that from the first time that's encountered, that Pad
>>setting persists across all my handlers, including the ones that produce
>>only plain text. I expect this behaviour is consistent with the
>>environment, my question though is how can I localise that setting so
>>that it does not affect other handlers, or, do I have to have to set
>>$Data::Dumper::Pad in all my handlers?
> 
> 
> Have you tried this:
> 
>   [% USE htmldumper = Dumper( Indent=1, Pad='<br>' ) %]
>   [% USE textdumper = Dumper( Indent=1 ) %]
> 
> then later...
> 
>   [% htmldumper.dump( data ) %]   # should use the '<br>' padding
>   [% textdumper.dump( data ) %]   # should not use the '<br>' padding
> 
> This is untested, but if I understand USE correctly, it should work.
> 
> 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!
> dave@xxxxx.xxx                                  Dig it all.
> 
> 


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

Re: [Templates] tpage extension
Myk Melez 14:00 on 29 Aug 2004

Re: [Templates] tpage extension
Johan Vromans 15:07 on 29 Aug 2004

Re: [Templates] tpage extension
Andy Wardley 07:03 on 02 Sep 2004

Re: [Templates] tpage extension
Andy Wardley 07:42 on 02 Sep 2004

Re: [Templates] tpage extension
slaven 08:37 on 02 Sep 2004

Re: [Templates] tpage extension
Dylan Hardison 13:06 on 03 Sep 2004

[Templates] correct usage of Dumper plugin
Jamie Echlin 16:04 on 02 Sep 2004

Re: [Templates] correct usage of Dumper plugin
Jamie Echlin 16:39 on 02 Sep 2004

Re: [Templates] correct usage of Dumper plugin
Darren Chamberlain 16:45 on 02 Sep 2004

Re: [Templates] correct usage of Dumper plugin
Jamie Echlin 17:33 on 02 Sep 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52