The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 07
LICENSE 11
MANIFEST 34
META.json 712
META.yml 2020
Makefile.PL 106
README 13
lib/Devel/FindPerl.pm 1719
t/00-compile.t 480
t/11-tainted.t 01
t/release-pod-coverage.t 210
t/release-pod-syntax.t 150
xt/author/00-compile.t 051
xt/release/pod-coverage.t 07
xt/release/pod-syntax.t 06
15 files changed (This is a version diff) 143137
@@ -1,5 +1,12 @@
 Revision history for Devel-FindPerl
 
+0.014     2015-06-15 23:53:25+02:00 Europe/Amsterdam
+          Properly quote exe_ext in regexp
+
+0.013     2015-06-14 19:50:03+02:00 Europe/Amsterdam
+          Skip taint test on portable perl
+          Various minor changes
+
 0.012     2013-11-20 14:57:15 Europe/Amsterdam
           Minor fixes in tests
 
@@ -22,7 +22,7 @@ This is free software, licensed under:
                      Version 1, February 1989
 
  Copyright (C) 1989 Free Software Foundation, Inc.
- 51 Franklin St, Suite 500, Boston, MA  02110-1335  USA
+ 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
@@ -1,3 +1,4 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.025.
 Changes
 INSTALL
 LICENSE
@@ -8,8 +9,8 @@ Makefile.PL
 README
 dist.ini
 lib/Devel/FindPerl.pm
-t/00-compile.t
 t/10-basics.t
 t/11-tainted.t
-t/release-pod-coverage.t
-t/release-pod-syntax.t
+xt/author/00-compile.t
+xt/release/pod-coverage.t
+xt/release/pod-syntax.t
@@ -4,7 +4,7 @@
       "Leon Timmermans <leont@cpan.org>, Randy Sims <randys@thepierianspring.org>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 5.005, CPAN::Meta::Converter version 2.132830",
+   "generated_by" : "Dist::Zilla version 5.025, CPAN::Meta::Converter version 2.143240",
    "license" : [
       "perl_5"
    ],
@@ -16,12 +16,16 @@
    "prereqs" : {
       "configure" : {
          "requires" : {
-            "ExtUtils::MakeMaker" : "6.30"
+            "ExtUtils::MakeMaker" : "0"
          }
       },
       "develop" : {
          "requires" : {
+            "File::Spec" : "0",
+            "IO::Handle" : "0",
+            "IPC::Open3" : "0",
             "Pod::Coverage::TrustPod" : "0",
+            "Test::More" : "0",
             "Test::Pod" : "1.41",
             "Test::Pod::Coverage" : "1.08"
          }
@@ -45,9 +49,6 @@
       },
       "test" : {
          "requires" : {
-            "File::Spec" : "0",
-            "IO::Handle" : "0",
-            "IPC::Open3" : "0",
             "Test::More" : "0"
          }
       }
@@ -55,7 +56,7 @@
    "provides" : {
       "Devel::FindPerl" : {
          "file" : "lib/Devel/FindPerl.pm",
-         "version" : "0.012"
+         "version" : "0.014"
       }
    },
    "release_status" : "stable",
@@ -70,6 +71,10 @@
          "web" : "https://github.com/Leont/devel-findperl"
       }
    },
-   "version" : "0.012"
+   "version" : "0.014",
+   "x_contributors" : [
+      "cm-perl <cm-perl@users.noreply.github.com>",
+      "Leon Timmermans <fawaka@gmail.com>"
+   ]
 }
 
@@ -3,37 +3,37 @@ abstract: 'Find the path to your perl'
 author:
   - 'Leon Timmermans <leont@cpan.org>, Randy Sims <randys@thepierianspring.org>'
 build_requires:
-  File::Spec: 0
-  IO::Handle: 0
-  IPC::Open3: 0
-  Test::More: 0
+  Test::More: '0'
 configure_requires:
-  ExtUtils::MakeMaker: 6.30
+  ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.005, CPAN::Meta::Converter version 2.132830'
+generated_by: 'Dist::Zilla version 5.025, CPAN::Meta::Converter version 2.143240'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+  version: '1.4'
 name: Devel-FindPerl
 provides:
   Devel::FindPerl:
     file: lib/Devel/FindPerl.pm
-    version: 0.012
+    version: '0.014'
 recommends:
-  ExtUtils::Config: 0.007
+  ExtUtils::Config: '0.007'
 requires:
-  Carp: 0
-  Cwd: 0
-  Exporter: 5.57
-  File::Basename: 0
-  File::Spec::Functions: 0
-  IPC::Open2: 0
-  Scalar::Util: 0
-  perl: 5.006
-  strict: 0
-  warnings: 0
+  Carp: '0'
+  Cwd: '0'
+  Exporter: '5.57'
+  File::Basename: '0'
+  File::Spec::Functions: '0'
+  IPC::Open2: '0'
+  Scalar::Util: '0'
+  perl: '5.006'
+  strict: '0'
+  warnings: '0'
 resources:
   bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Devel-FindPerl
   repository: git://github.com/Leont/devel-findperl.git
-version: 0.012
+version: '0.014'
+x_contributors:
+  - 'cm-perl <cm-perl@users.noreply.github.com>'
+  - 'Leon Timmermans <fawaka@gmail.com>'
@@ -1,23 +1,24 @@
 
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.025.
 use strict;
 use warnings;
 
 use 5.006;
 
-use ExtUtils::MakeMaker 6.30;
+use ExtUtils::MakeMaker;
 
 
 
 my %WriteMakefileArgs = (
   "ABSTRACT" => "Find the path to your perl",
   "AUTHOR" => "Leon Timmermans <leont\@cpan.org>, Randy Sims <randys\@thepierianspring.org>",
-  "BUILD_REQUIRES" => {},
   "CONFIGURE_REQUIRES" => {
-    "ExtUtils::MakeMaker" => "6.30"
+    "ExtUtils::MakeMaker" => 0
   },
   "DISTNAME" => "Devel-FindPerl",
   "EXE_FILES" => [],
   "LICENSE" => "perl",
+  "MIN_PERL_VERSION" => "5.006",
   "NAME" => "Devel::FindPerl",
   "PREREQ_PM" => {
     "Carp" => 0,
@@ -31,12 +32,9 @@ my %WriteMakefileArgs = (
     "warnings" => 0
   },
   "TEST_REQUIRES" => {
-    "File::Spec" => 0,
-    "IO::Handle" => 0,
-    "IPC::Open3" => 0,
     "Test::More" => 0
   },
-  "VERSION" => "0.012",
+  "VERSION" => "0.014",
   "test" => {
     "TESTS" => "t/*.t"
   }
@@ -47,12 +45,10 @@ my %FallbackPrereqs = (
   "Carp" => 0,
   "Cwd" => 0,
   "Exporter" => "5.57",
+  "ExtUtils::MakeMaker" => 0,
   "File::Basename" => 0,
-  "File::Spec" => 0,
   "File::Spec::Functions" => 0,
-  "IO::Handle" => 0,
   "IPC::Open2" => 0,
-  "IPC::Open3" => 0,
   "Scalar::Util" => 0,
   "Test::More" => 0,
   "strict" => 0,
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution Devel-FindPerl,
-version 0.012:
+version 0.014:
 
   Find the path to your perl
 
@@ -11,3 +11,5 @@ This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
 
 
+This README file was generated by Dist::Zilla::Plugin::Readme v5.025.
+
@@ -1,7 +1,5 @@
 package Devel::FindPerl;
-{
-  $Devel::FindPerl::VERSION = '0.012';
-}
+$Devel::FindPerl::VERSION = '0.014';
 use strict;
 use warnings;
 
@@ -33,8 +31,8 @@ sub _discover_perl_interpreter {
 
 	my @potential_perls;
 
-	# Try 1, Check $^X for absolute path
-	push @potential_perls, [ file_name_is_absolute($^X) ? $^X : rel2abs($^X) ] unless tainted($^X);
+	# Try 1, Check $^X for absolute and relative path
+	push @potential_perls, file_name_is_absolute($^X) ? [ $^X ] : length +(splitpath($^X))[1] ? [ rel2abs($^X) ] : ();
 
 	# Try 2, Last ditch effort: These two option use hackery to try to locate
 	# a suitable perl. The hack varies depending on whether we are running
@@ -44,16 +42,16 @@ sub _discover_perl_interpreter {
 		# perl, we can keep moving up the directory tree until we find our
 		# binary. We wouldn't do this under any other circumstances.
 
-		my $perl_src = realpath(_perl_src());
+		my $perl_src = _perl_src();
 		if (defined($perl_src) && length($perl_src)) {
-			my $uninstperl = rel2abs(catfile($perl_src, $perl_basename));
+			my $uninstperl = catfile($perl_src, $perl_basename);
 			# When run from the perl core, @INC will include the directories
 			# where perl is yet to be installed. We need to reference the
 			# absolute path within the source distribution where it can find
 			# it's Config.pm This also prevents us from picking up a Config.pm
 			# from a different configuration that happens to be already
 			# installed in @INC.
-			push @potential_perls, [ $uninstperl, '-I' . catdir(dirname($^X), 'lib') ];
+			push @potential_perls, [ $uninstperl, '-I' . catdir($perl_src, 'lib') ];
 		}
 	}
 	else {
@@ -62,15 +60,16 @@ sub _discover_perl_interpreter {
 		# uninstalled perl in a perl source tree.
 
 		push @potential_perls, [ $config->get('perlpath') ];
-		push @potential_perls, map { [ catfile($_, $perl_basename) ] } grep { !tainted($_) } path();
+		push @potential_perls, map { [ catfile($_, $perl_basename) ] } path();
 	}
+	@potential_perls = grep { !tainted($_->[0]) } @potential_perls;
 
 	# Now that we've enumerated the potential perls, it's time to test
 	# them to see if any of them match our configuration, returning the
 	# absolute path of the first successful match.
 	my $exe = $config->get('exe_ext');
 	foreach my $thisperl (@potential_perls) {
-		$thisperl->[0] .= $exe if length $exe and $thisperl->[0] !~ m/$exe$/i;
+		$thisperl->[0] .= $exe if length $exe and $thisperl->[0] !~ m/\Q$exe\E$/i;
 		return $thisperl if -f $thisperl->[0] && perl_is_same(@{$thisperl});
 	}
 
@@ -106,20 +105,23 @@ sub _perl_src {
 	}
 
 	carp "PERL_CORE is set but I can't find your perl source!\n";
-	return; # return empty string if $ENV{PERL_CORE} but can't find dir ???
+	return;
 }
 
 sub perl_is_same {
-	my @cmd = @_;
+	my @perl = @_;
+	return lc _capture_command(@perl, qw(-MConfig=myconfig -e print -e myconfig)) eq lc Config->myconfig;
+}
 
-	push @cmd, qw(-MConfig=myconfig -e print -e myconfig);
+sub _capture_command {
+	my (@command) = @_;
 
-	local @ENV{qw/PATH IFS CDPATH ENV BASH_ENV/} = ('') x 5;
-	my $pid = open2(my($in, $out), @cmd);
+	local @ENV{qw/PATH IFS CDPATH ENV BASH_ENV/};
+	my $pid = open2(my($in, $out), @command);
 	binmode $in, ':crlf' if $^O eq 'MSWin32';
 	my $ret = do { local $/; <$in> };
 	waitpid $pid, 0;
-	return lc $ret eq lc Config->myconfig;
+	return $ret;
 }
 
 sub Devel::FindPerl::Config::get {
@@ -143,7 +145,7 @@ Devel::FindPerl - Find the path to your perl
 
 =head1 VERSION
 
-version 0.012
+version 0.014
 
 =head1 SYNOPSIS
 
@@ -1,48 +0,0 @@
-use strict;
-use warnings;
-
-# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.036
-
-use Test::More  tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
-
-
-
-my @module_files = (
-    'Devel/FindPerl.pm'
-);
-
-
-
-# no fake home requested
-
-my $inc_switch = q[-Mblib];
-
-use File::Spec;
-use IPC::Open3;
-use IO::Handle;
-
-my @warnings;
-for my $lib (@module_files)
-{
-    # see L<perlfaq8/How can I capture STDERR from an external command?>
-    open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
-    my $stderr = IO::Handle->new;
-
-    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
-    binmode $stderr, ':crlf' if $^O eq 'MSWin32';
-    my @_warnings = <$stderr>;
-    waitpid($pid, 0);
-    is($?, 0, "$lib loaded ok");
-
-    if (@_warnings)
-    {
-        warn @_warnings;
-        push @warnings, @_warnings;
-    }
-}
-
-
-
-is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
-
-
@@ -11,6 +11,7 @@ use Devel::FindPerl qw/find_perl_interpreter perl_is_same/;
 my $perlpath = $Config{perlpath};
 plan(skip_all => 'Taint test can\'t be run from uninstalled perl') if $ENV{PERL_CORE};
 plan(skip_all => 'Taint test can\'t be run for relocatable perl') if $Config{userelocatableinc};
+plan(skip_all => 'Taint test can\'t be run for Strawberry Portable') if $INC{"Portable/Config.pm"};
 plan(skip_all => "Perl not in perlpath '$perlpath'") unless -x $perlpath and perl_is_same($perlpath);
 plan(skip_all => 'Testrun without taint mode') if not $^T;
 
@@ -1,21 +0,0 @@
-#!perl
-
-BEGIN {
-  unless ($ENV{RELEASE_TESTING}) {
-    require Test::More;
-    Test::More::plan(skip_all => 'these tests are for release candidate testing');
-  }
-}
-
-
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.08";
-plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
-  if $@;
-
-eval "use Pod::Coverage::TrustPod";
-plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
-  if $@;
-
-all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
@@ -1,15 +0,0 @@
-#!perl
-
-BEGIN {
-  unless ($ENV{RELEASE_TESTING}) {
-    require Test::More;
-    Test::More::plan(skip_all => 'these tests are for release candidate testing');
-  }
-}
-
-use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
-
-all_pod_files_ok();
@@ -0,0 +1,51 @@
+use 5.006;
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.051
+
+use Test::More;
+
+plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
+
+my @module_files = (
+    'Devel/FindPerl.pm'
+);
+
+
+
+# no fake home requested
+
+my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
+
+use File::Spec;
+use IPC::Open3;
+use IO::Handle;
+
+open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
+
+my @warnings;
+for my $lib (@module_files)
+{
+    # see L<perlfaq8/How can I capture STDERR from an external command?>
+    my $stderr = IO::Handle->new;
+
+    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
+    binmode $stderr, ':crlf' if $^O eq 'MSWin32';
+    my @_warnings = <$stderr>;
+    waitpid($pid, 0);
+    is($?, 0, "$lib loaded ok");
+
+    if (@_warnings)
+    {
+        warn @_warnings;
+        push @warnings, @_warnings;
+    }
+}
+
+
+
+is(scalar(@warnings), 0, 'no warnings found')
+    or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
+
+
@@ -0,0 +1,7 @@
+#!perl
+# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
+
+use Test::Pod::Coverage 1.08;
+use Pod::Coverage::TrustPod;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
@@ -0,0 +1,6 @@
+#!perl
+# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use Test::More;
+use Test::Pod 1.41;
+
+all_pod_files_ok();