diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-06-18 11:26:50 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-06-18 20:49:13 +0200 |
commit | 2b7bd0cd8c00be3c9bbbd23732b6719cd9a85768 (patch) | |
tree | 8e7e49ffc3d2c014de641ca460c79b5a654283e3 /win32 | |
parent | 86714aaae213175ea8c716ad22c1e10300d5bf61 (diff) | |
download | perl-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.pm | 16 |
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"); } } |