Subject: | Template::Declare and Moose don't get along |
A Møøse once bit my Template::Declare ...
No realli! She was Karving her initials on the møøse with the sharpened
end of an custØm @Expørt config given her by Øbra - her brother-in-law -
an Oslo dentist and star of many Norwegian møvies: "The Høt Hands of an
Oslo Dentist", "Fillings of Passion", "The Huge Mølars of Horst
Nordfink".
We apologise for the fault in the ticket reporting. Those responsible
have been sacked.
If you try this:
use Moose;
use Template::Declare::Tags qw( HTML );
you will get two separate conniption fits from Moose.
1. The "with" sub will be replaced, which tends to do nasty things if
you want to implement roles.
2. The "meta" sub will be replaced, which tends to do nasty things to
everything related to Moose.
This gets even worse if you want to use MooseX::Declare and
Template::Declare.
I am willing to contribute a patch if one of the maintainers will tell
me what they consider the best solution to be.
The solutions that come to mind include:
1. Rename "with" and "meta" to something else. (e.g., "wik"/"metadata")
2. Add an option to TD::Tags::import() to prevent import or offer an
alternate name for "with". E.g.:
use Template::Declare::Tags qw( -moose_friendly HTML );
3. Do the latter, but automagically detect Moose friendly mode.
use Moose;
use Template::Declare::Tags ( HTML ); # warn "I see you are using Moose;
so -moose_friendly mode is. Please use -moose_friendly or -
moose_unfriendly in your with use Template::Declare::Tags to avoid this
warning in the future."
4. None of the above...
Anyway, Moose-friendly templates would be nice...