From: Matt S Trout Date: Sun, 12 Aug 2012 10:41:46 +0000 (+0000) Subject: use UNIVERSAL::ref to make TT internals be less stupid X-Git-Tag: v1.000000~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=586054e05c7ac2fcdb3b7a27442f8b1586c64105;p=scpubgit%2FHTML-String.git use UNIVERSAL::ref to make TT internals be less stupid --- diff --git a/Makefile.PL b/Makefile.PL index 7a0cf78..2897ead 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,5 +10,6 @@ WriteMakefile( 'Data::Munge' => '0.04', 'B::Hooks::EndOfScope' => '0.11', 'strictures' => 1, + 'UNIVERSAL::ref' => 0.14, } ); diff --git a/lib/HTML/String/TT.pm b/lib/HTML/String/TT.pm index 6e35360..360f056 100644 --- a/lib/HTML/String/TT.pm +++ b/lib/HTML/String/TT.pm @@ -2,6 +2,15 @@ package HTML::String::TT; use strictures 1; +BEGIN { + if ($INC{"Template.pm"} and !$INC{"UNIVERSAL/ref.pm"}) { + warn "Template was loaded before we could load UNIVERSAL::ref" + ." - this means you're probably going to get weird errors." + ." To avoid this, use HTML::String::TT before loading Template." + } + require UNIVERSAL::ref; +} + use HTML::String; use HTML::String::TT::Directive; use Safe::Isa; diff --git a/lib/HTML/String/Value.pm b/lib/HTML/String/Value.pm index 46181d4..99a1284 100644 --- a/lib/HTML/String/Value.pm +++ b/lib/HTML/String/Value.pm @@ -1,6 +1,7 @@ package HTML::String::Value; use strictures 1; +use UNIVERSAL::ref; use Safe::Isa; use Data::Munge; @@ -124,4 +125,6 @@ sub clone { return ref($self)->new(@{$self->{parts}}); } +sub ref { '' } + 1;