diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-20 16:33:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-20 16:33:36 +0000 |
commit | 2dafcda5895076f3d328c360c2e49544517c018b (patch) | |
tree | 01febf445e5e1ceacb1712df6af15c40d21868a9 | |
parent | 3e96aee66e5f1fdc511bc3f115d64ac83a297623 (diff) |
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
-rw-r--r-- | Master/tlpkg/tlpostcode/haranoaji-tlpost.pl | 18 |
1 files changed, 9 insertions, 9 deletions
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; } |