|
Randal, Thanks for the help. With a bit of fanangling, I was able to get it working. Here's my changes: In my main program: I had to "use My::Stash" AFTER "use Template". Before had no effect. package My::Stash; use base qw(Template::Stash); sub get { my $self = shift; my $value = $self->SUPER::get(@_); # get original value die "Missing parameter '$_[0]' in template" if $value eq '' || ! defined $value; return $value; } $Template::Config::STASH = __PACKAGE__; # use me, not that 1; Unforunately, I can't do "unless defined" because of: (Template/Stash.pm) sub get { ... return defined $result ? $result : $self->undefined($ident, $args); } sub undefined { my ($self, $ident, $args); return ''; } It seems misleading for undefined to return a null string. Once again, thanks for your help! -Tommy. Randal L. Schwartz wrote: _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates |
- [Templates] Missing Variable Question Thomas Falgout
- Re: [Templates] Missing Variable Question Randal L. Schwartz
- Re: [Templates] Missing Variable Question Thomas Falgout
- RE: [Templates] Missing Variable Question Sergey Martynoff
- Re: [Templates] Missing Variable Question Dave Howorth
- Re: [Templates] Missing Variable Question Randal L. Schwartz
