update:
get tarball at Template-Plugin-Stash-0.02.tar.gz.
=head1 NAME Template::Plugin::Stash - expose the stash, ideal for I<Dumper>ing... =head1 SYNOPSIS [% USE Stash %] [% USE Dumper Indent = 1%] <pre>[% Dumper.dump_html( Stash.stash() ) %]</pre> =head1 DESCRIPTION Instead of messing with C<< [% PERL %] >> blocks to get at the stash, simply C<< [% USE Stash %] >>. Output will look something like $VAR1 = bless( { 'global' => {}, 'var1' => 6666666, 'var2' => { 'e' => 'f', 'g' => 'h', 'a' => 'b', 'c' => 'd' }, }, 'Template::Stash::XS' ); which should be all you need. =head1 SEE ALSO L<Template::Plugin|Template::Plugin>, L<Template::Plugin::Dumper|Template::Plugin::Dumper>. =head1 LICENSE Copyright (c) 2003 by D.H. (PodMaster). All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you don't know what this means +, visit http://perl.org/ or http://cpan.org/. =cut package Template::Plugin::Stash; use strict; use base qw[ Template::Plugin ]; use vars '$VERSION'; $VERSION = 0.02; sub new { my( $class, $con ) = @_; return bless { _CONTEXT => $con }, $class; } sub stash { my $self = shift; my $stash = $self->{_CONTEXT}->stash()->clone(); delete $stash->{$_} for qw[ template dec inc component Stash ], grep { /^_/ } keys %$stash; for my $k( keys %$stash ){ delete $stash->{$k} if ref($stash->{$k}) =~ /^\QTemplate::Plu +gin/; } return $stash; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template::Plugin::Stash - expose the stash, ideal for dumpering...
by theorbtwo (Prior) on Dec 23, 2003 at 19:27 UTC | |
by PodMaster (Abbot) on Dec 24, 2003 at 07:17 UTC |