http://www.perlmonks.org?node_id=435296


in reply to Using DateTime together with Template::Toolkit

If you were using the XS Stash, I don't think this would be a problem.

If you really have a reason to use the non-XS stash, you can patch TT. The fix is to change the code that creates the $atroot variable in the _dotop method. It is described in this post to the TT mailing list. There is similar code in _assign that could probably stand to be patched as well.

Note: The change in question adds a dependency on the Scalar::Util module, which should work on whatever version of Perl you can run TT on.

  • Comment on Re: Using DateTime together with Template::Toolkit

Replies are listed 'Best First'.
Re^2: Using DateTime together with Template::Toolkit
by Corion (Patriarch) on Mar 01, 2005 at 07:27 UTC

    I don't know resp. didn't check if the XS Stash is active or not, but it sure sounds like if it isn't. The patch you mentioned sounds promising - I will try that!

    Of course, there shouldn't be a difference between the XS version and the Pure Perl version of Template::Stash.

      I agree that they should work the same, but in this case, there is a discrepency.

      I only suggested using the XS Stash instead since it seems to work correctly. Also, that message was posted to the TT mailing list a few months ago (in response to a message from the maintainer, so he's obviously aware of it) and there hasn't been a release containing the fix yet. That makes me think that waiting for the pure Perl Stash to work may take a while.

      Why not? They do different things ...

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.