clean up TT override
Matt S Trout [Sat, 11 Aug 2012 17:32:14 +0000 (17:32 +0000)]
lib/HTML/String/TT/Directive.pm

index 11fa963..b77d501 100644 (file)
@@ -2,12 +2,13 @@ package HTML::String::TT::Directive;
 
 use strictures 1;
 use HTML::String::Overload ();
+use Data::Munge;
 use base qw(Template::Directive);
 
 sub template {
-    my $result = Template::Directive::pad(shift->SUPER::template(@_), 2);
-    $result =~ s/sub {/sub { use HTML::String::Overload;/;
-    $result;
+    return byval {
+        s/sub {/sub { use HTML::String::Overload;/;
+    } Template::Directive::pad(shift->SUPER::template(@_), 2);
 }
 
 1;