Commits

Shlomi Fish  committed d999680

Extract into a module.

  • Participants
  • Parent commits c66afa7

Comments (0)

Files changed (2)

File lib/Shlomif/WrapAsUtf8.pm

+package Shlomif::WrapAsUtf8;
+
+use strict;
+use warnings;
+
+use parent 'Exporter';
+
+our @EXPORT_OK = (qw(_wrap_as_utf8));
+
+sub _wrap_as_utf8 {
+    my ($cb) = @_;
+
+    binmode STDOUT, ":utf8";
+
+    $cb->();
+
+    binmode STDOUT, ":raw";
+}
+
+1;

File lib/local-defs.wml

 <set-var latemp_with_html_head_nav_links="<latemp_mynot "$(PRINTABLE)" />" />
 <set-var latemp_with_html_head_stylesheets="<latemp_mynot "$(PRINTABLE)" />" />
 <:{
-    use utf8;
-
-    sub _wrap_as_utf8 {
-        my ($cb) = @_;
-
-        binmode STDOUT, ":utf8";
-
-        $cb->();
-
-        binmode STDOUT, ":raw";
-    }
-
+    use Shlomif::WrapAsUtf8 (qw(_wrap_as_utf8));
 }:>
 <define-tag latemp_get_breadcrumbs_trail_unconditionally>
 <:{