From: Jess Robinson Date: Sat, 11 Aug 2012 19:18:28 +0000 (+0100) Subject: TT's new takes a hashref or a hash X-Git-Tag: v1.000000~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7772496151f4912a508edcb9d2fa37e402dffa8f;p=scpubgit%2FHTML-String.git TT's new takes a hashref or a hash --- diff --git a/lib/HTML/String/TT.pm b/lib/HTML/String/TT.pm index fb1f1cb..90b1ec5 100644 --- a/lib/HTML/String/TT.pm +++ b/lib/HTML/String/TT.pm @@ -13,7 +13,7 @@ sub new { FACTORY => 'HTML::String::TT::Directive' ), STASH => Template::Stash->new, - @_ + (ref($_[0]) eq 'HASH' ? %{$_[0]} : @_) ); }