diff options
-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; } |