On Mon, 7 Aug 2006, Bill Moseley wrote:
BTW should DateTime die if both items are not a DateTime objects?
Why I ask is the backtrace led me to this in Template::Stash:
sub _dotop {
my ($self, $root, $item, $args, $lvalue) = @_;
my $rootref = ref $root;
my $atroot = ($root eq $self);
my ($value, @result);
where the test for ($root eq $self) was causing the exception in
DateTime because one object was not a DateTime object.
If they are not both DateTime objects can we state that they are not
equal?
The reason it dies is because I think it's reasonable to assume that
comparing a DateTime object to something else is an error in the caller's
code. Either a typo, or a function/method returning something other than
what they expect, etc.
What TT2 is doing is rather wrong. It should probably be using something
like Scalar::Util::refaddr.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/