The stupid question is the question not asked | |
PerlMonks |
Using DateTime together with Template::Toolkitby Corion (Patriarch) |
on Feb 28, 2005 at 21:45 UTC ( [id://435201]=perlquestion: print w/replies, xml ) | Need Help?? |
Corion has asked for the wisdom of the Perl Monks concerning the following question: I am most likely looking in the wrong places and have missed some crucial piece of information. I can't get DateTime objects to play well with Template::Stash - the Template::Stash seems to want to compare the DateTime object against the template root, but the DateTime object does not want to be compared with anything other than a DateTime object, or something sufficiently similar. See my code below - it is some convoluted way of printing todays date, except it doesn't:
After patching DateTime.pm so it gives some better error diagnostics, I get
but I don't want to believe that nobody has used Template::Toolkit and DateTime together, so the error must be somewhere in my usage of one of the two. Update: DateTime v0.28, Template::Toolkit 2.14 Update 2: I hacked myself a workaround by removing the overloaded string comparison of DateTime. This is horribly ugly and there must be a better way :-(
Back to
Seekers of Perl Wisdom
|
|