texlive[54419] Master/tlpkg/tlpostcode/haranoaji-tlpost.pl: require

commits+karl at tug.org commits+karl at tug.org
Fri Mar 20 17:33:36 CET 2020


Revision: 54419
          http://tug.org/svn/texlive?view=revision&revision=54419
Author:   karl
Date:     2020-03-20 17:33:36 +0100 (Fri, 20 Mar 2020)
Log Message:
-----------
require if w32, instead of use Encode::Locale;
evidently not part of standard Perl. Also only
call binmode if w32.

Modified Paths:
--------------
    trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl

Modified: trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl
===================================================================
--- trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl	2020-03-20 15:35:06 UTC (rev 54418)
+++ trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl	2020-03-20 16:33:36 UTC (rev 54419)
@@ -36,20 +36,20 @@
 use utf8;
 use feature 'state';
 use Encode;
-use Encode::Locale;
 
-binmode (STDIN, ':encoding(console_in)');
-binmode (STDOUT, ':encoding(console_out)');
-binmode (STDERR, ':encoding(console_out)');
-
-print "haranoaji-tlpost\n";
-
 if (win32 ()) {
-    # `use Win32::API;` raises error in non-Windows even within this block.
+    binmode (STDIN, ':encoding(console_in)');
+    binmode (STDOUT, ':encoding(console_out)');
+    binmode (STDERR, ':encoding(console_out)');
+    print "haranoaji-tlpost\n";
+    
+    # These packages are not necessarily available on non-Windows, so
+    # read them at runtime instead of compile time.
+    require Encode::Locale;
     require Win32::API;
     Win32::API->import ();
 } else {
-    print "For non-Windows, do nothing\n";
+    print "$0: For non-Windows, do nothing\n";
     exit 0;
 }
 



More information about the tex-live-commits mailing list.