summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-06-18 11:26:50 +0200
committerNicholas Clark <nick@ccl4.org>2013-06-18 20:49:13 +0200
commit2b7bd0cd8c00be3c9bbbd23732b6719cd9a85768 (patch)
tree8e7e49ffc3d2c014de641ca460c79b5a654283e3 /win32
parent86714aaae213175ea8c716ad22c1e10300d5bf61 (diff)
downloadperl-2b7bd0cd8c00be3c9bbbd23732b6719cd9a85768.tar.gz
In FindExt, use File::Find instead of shelling out to a dir command.
The FindExt code is tested on *nix, and at least some systems have a dir executable, which generates warnings to stderr when invoked with parameters intended for the Win32 dir command. File::Find is portable, and avoids starting a new process.
Diffstat (limited to 'win32')
-rw-r--r--win32/FindExt.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/win32/FindExt.pm b/win32/FindExt.pm
index c7e52aef05..2e4d6c1d40 100644
--- a/win32/FindExt.pm
+++ b/win32/FindExt.pm
@@ -54,13 +54,15 @@ sub set_static_extensions {
# For other nested extensions, this is handled automatically by
# the appropriate Makefile.PL.
if ($ext{Encode} && $ext{Encode} eq 'static') {
- foreach my $file (`dir /s /b ..\\cpan\\Encode\\Makefile.PL`) {
- if ($file =~ /\b(Encode\\.+)\\Makefile\.PL/) {
- (my $xxx = $1) =~ s|\\|/|g;
- $static{$xxx} = 1;
- $ext{$xxx} = 'static';
- }
- }
+ require File::Find;
+ File::Find::find({
+ no_chdir => 1,
+ wanted => sub {
+ return unless m!\b(Encode/.+)/Makefile\.PL!;
+ $static{$1} = 1;
+ $ext{$1} = 'static';
+ },
+ }, "../cpan/Encode");
}
}