Tony Bowden wrote:

It returns a raw list. The code in question is Class::DBI, and this
isn't something that's easily changed at this point!

For the most part everything Just Works, but this one has been annoying
me today.



Well, returning an empty list pretty much ends the game for hacking around in Stash OPs. If you look at the get() in Stash.pm you'll see this:
return defined $result ? $result : '';


So what you'd need to do is this:

my $tt = Template->new({
   FILTERS =>{ zero=>sub { return $_[0] ? $_[0] : "0" },
   }
);
$tt->process(\*DATA => {
 mylist => sub { return () },
});


And try [% mylist.size|zero %]


Which should at least get you what you want with a minimum of angst.

--mark

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to