CC: | rstorment [...] mcclatchyinteractive.com |
Subject: | List.defined returns true when called with a string |
I know List.defined is supposed to called with an integer..
But if it's called with a string, I'd think the right behavior would be
to return false (since nothing could possibly be defined at an invalid
index).
However, it returns true (if the list isn't empty anyway):
$ echo '[% list = [1]; list.defined('asdf') && "true" %]'|tpage
Argument "" isn't numeric in array element at
/usr/local/lib/perl/5.10.0/Template/VMethods.pm line 421, <STDIN> line 1.
true
I can work on a patch if this seems like something worth changing.