diff -Nurd Encode-JISX0213-0.04.orig/Makefile.PL Encode-JISX0213-0.04/Makefile.PL --- Encode-JISX0213-0.04.orig/Makefile.PL 2015-06-27 03:36:24.000000000 -0400 +++ Encode-JISX0213-0.04/Makefile.PL 2018-06-23 18:35:21.000000000 -0400 @@ -32,6 +32,9 @@ } my ($enc2xs, $encode_h) = ('enc2xs', '.'); +if (-r $ENV{ENC2XS}) { + $enc2xs = $ENV{ENC2XS} +} else { my @path_ext = (''); @path_ext = split(';', $ENV{PATHEXT}) if $^O eq 'MSWin32'; PATHLOOP: @@ -45,19 +48,16 @@ } } } +} $enc2xs or die "enc2xs not found!"; print "enc2xs is $enc2xs\n"; -my %encode_h = (); for my $d (@INC) { my $dir = File::Spec->catfile($d, "Encode"); my $file = File::Spec->catfile($dir, "encode.h"); - -f $file and $encode_h{$dir} = -M $file; + -f $file and $encode_h = $dir and last; } -%encode_h or die "encode.h not found!"; - -# find the latest one -($encode_h) = sort { $encode_h{$b} <=> $encode_h{$a} } keys %encode_h; +$encode_h or die "encode.h not found!"; print "encode.h is at $encode_h\n"; # get XS version.