From 2dafcda5895076f3d328c360c2e49544517c018b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 20 Mar 2020 16:33:36 +0000 Subject: require if w32, instead of use Encode::Locale; evidently not part of standard Perl. Also only call binmode if w32. git-svn-id: svn://tug.org/texlive/trunk@54419 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlpostcode/haranoaji-tlpost.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Master/tlpkg/tlpostcode/haranoaji-tlpost.pl') diff --git a/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl b/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl index 84576fa1c16..1fb281eb0df 100644 --- a/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl +++ b/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl @@ -36,20 +36,20 @@ use warnings; 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; } -- cgit v1.2.3