diff -Nurd Encode-HanExtra-0.23.orig/Makefile.PL Encode-HanExtra-0.23/Makefile.PL --- Encode-HanExtra-0.23.orig/Makefile.PL 2018-06-23 17:50:01.000000000 -0400 +++ Encode-HanExtra-0.23/Makefile.PL 2018-06-23 18:20:20.000000000 -0400 @@ -34,6 +34,9 @@ #### DO NOT EDIT BEYOND THIS POINT! require File::Spec; my ($enc2xs, $encode_h) = (); +if (-r $ENV{ENC2XS}) { + $enc2xs = $ENV{ENC2XS} +} else { PATHLOOP: for my $d (@Config{qw/bin sitebin vendorbin/}, (split /$Config{path_sep}/o, $ENV{PATH})) @@ -43,18 +46,15 @@ -r $path and $enc2xs = $path and last PATHLOOP; } } +} $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"; name 'Encode-HanExtra';