TT's new takes a hashref or a hash
Jess Robinson [Sat, 11 Aug 2012 19:18:28 +0000 (20:18 +0100)]
lib/HTML/String/TT.pm

index fb1f1cb..90b1ec5 100644 (file)
@@ -13,7 +13,7 @@ sub new {
             FACTORY => 'HTML::String::TT::Directive'
         ),
         STASH => Template::Stash->new,
-        @_
+        (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_)
     );
 }