The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
CONTRIBUTING 0205
Changes 0186
MANIFEST 89
META.json 23
META.yml 23
Makefile.PL 24
PATCHING 2120
README 312
TODO 780
bundled/CPAN-Meta/CPAN/Meta/Converter.pm 25
bundled/CPAN-Meta/CPAN/Meta/Requirements.pm 5980
bundled/CPAN-Meta-Requirements/CPAN/Meta/Requirements.pm 01030
bundled/ExtUtils-Manifest/ExtUtils/MANIFEST.SKIP 15
bundled/ExtUtils-Manifest/ExtUtils/Manifest.pm 3945
bundled/File-Copy-Recursive/File/Copy/Recursive.pm 6960
bundled/version/version/Internals.pod 6980
bundled/version/version/vpp.pm 9310
bundled/version/version.pm 2130
bundled/version/version.pod 3210
lib/ExtUtils/Command/MM.pm 46
lib/ExtUtils/Liblist/Kid.pm 1123
lib/ExtUtils/Liblist.pm 11
lib/ExtUtils/MM.pm 11
lib/ExtUtils/MM_AIX.pm 11
lib/ExtUtils/MM_Any.pm 26152
lib/ExtUtils/MM_BeOS.pm 12
lib/ExtUtils/MM_Cygwin.pm 12
lib/ExtUtils/MM_DOS.pm 11
lib/ExtUtils/MM_Darwin.pm 11
lib/ExtUtils/MM_MacOS.pm 11
lib/ExtUtils/MM_NW5.pm 11
lib/ExtUtils/MM_OS2.pm 12
lib/ExtUtils/MM_QNX.pm 11
lib/ExtUtils/MM_UWIN.pm 11
lib/ExtUtils/MM_Unix.pm 110168
lib/ExtUtils/MM_VMS.pm 12
lib/ExtUtils/MM_VOS.pm 11
lib/ExtUtils/MM_Win32.pm 1935
lib/ExtUtils/MM_Win95.pm 11
lib/ExtUtils/MY.pm 11
lib/ExtUtils/MakeMaker/Config.pm 11
lib/ExtUtils/MakeMaker/FAQ.pod 11
lib/ExtUtils/MakeMaker/Locale.pm 0348
lib/ExtUtils/MakeMaker/Tutorial.pod 11
lib/ExtUtils/MakeMaker/version/regex.pm 0123
lib/ExtUtils/MakeMaker/version/vpp.pm 01028
lib/ExtUtils/MakeMaker/version.pm 055
lib/ExtUtils/MakeMaker.pm 54139
lib/ExtUtils/Mkbootstrap.pm 11
lib/ExtUtils/Mksymlists.pm 914
lib/ExtUtils/testlib.pm 11
my/bundles.pm 16697
t/FIRST_MAKEFILE.t 11
t/INSTALL_BASE.t 4150
t/Liblist_Kid.t 6954
t/MM_Unix.t 11
t/MakeMaker_Parameters.t 4442
t/PL_FILES.t 56
t/basic.t 5361
t/cd.t 44
t/echo.t 34
t/lib/MakeMaker/Test/Setup/Unicode.pm 090
t/lib/MakeMaker/Test/Setup/XS.pm 29
t/lib/MakeMaker/Test/Utils.pm 65
t/meta_convert.t 11
t/min_perl_version.t 56
t/miniperl.t 115
t/oneliner.t 12
t/parse_version.t 01
t/pm_to_blib.t 711
t/postamble.t 06
t/prereq.t 06
t/recurs.t 46
t/several_authors.t 69
t/unicode.t 087
t/vstrings.t 073
t/writemakefile_args.t 28
t/xs.t 1417
78 files changed (This is a version diff) 43564885
@@ -0,0 +1,205 @@
+"The easy way is always mined.
+ The important things are always simple.
+ The simple things are always hard."
+        -- Some of Murphy's Laws of Combat
+
+This is a short set of guidelines for those contributing
+ExtUtils::MakeMaker.  Its not an iron-clad set of rules, but just
+things which make life easier when reading and integrating a patch.
+
+Reporting bugs
+
+- Often the only information we have for fixing a bug is contained in your
+  report.  So...
+
+- Please report your bugs via http://rt.cpan.org or
+  https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues or
+  by mailing to makemaker@perl.org.
+  
+  RT or GitHub are preferred.
+
+- Please report your bug immediately upon encountering it.  Do not wait
+  until you have a patch to fix the bug.  Patches are good, but not at
+  the expense of timely bug reports.
+
+- Please be as verbose as possible.  Include the complete output of
+  your 'make test' or even 'make test TEST_VERBOSE=1' and a copy of the 
+  generated Makefile.  Err on the side of verbosity.  The more data we
+  have to work with, the faster we can diagnose the problem.
+
+- If you find an undocumented feature, or if a feature has changed/been
+  added which causes a problem, report it.  Do not assume it was done
+  deliberately.  Even if it was done deliberately, we still want to hear
+  if it caused problems.
+
+- If you're testing MakeMaker against a development version of Perl,
+  please also check it against the latest stable version.  This makes it
+  easier to figure out if its MakeMaker or Perl at fault.
+
+
+Pull Request
+
+- If you wrote a patch already, please Pull Request on GitHub.
+
+- Pull Request against the latest development snapshot from GitHub
+  repository are preferred.
+  
+- Pull Request against the latest CPAN version are ok, too.
+
+
+Code formatting
+
+- No literal tabs (except where necessary inside Makefile code, obviously).
+
+- 4 character indentation.
+
+- this_style is prefered instead of studlyCaps.
+
+- Private subroutine names (ie. those used only in the same package
+  they're declared in) should start with an underscore (_sekret_method).
+
+- Protected subroutines (ie. ones intended to be used by other modules in
+  ExtUtils::*) should be named normally (no leading underscore) but
+  documented as protected (see Documentation below).
+
+- Do not use indirect object syntax (ie. new Foo::Bar (@args))
+
+- make variables use dollar signs like Perl scalars.  This causes problems
+  when you have to mix them both in a string.  If you find yourself
+  backwacking lots of dollar signs because you have one interpolated
+  perl variable, like this:
+
+    return <<EOT;
+subdirs ::
+	\$(NOECHO)cd $subdir && \$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
+
+EOT
+
+  or are switching quoting contexts:
+
+    return q{
+subdirs ::
+	$(NOECHO)cd }.$subdir.q{ && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
+
+};
+
+  consider using sprintf instead.
+
+    return sprintf <<'EOT', $subdir;
+subdirs ::
+	$(NOECHO)cd %s && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
+
+EOT
+
+
+Refactoring and Cleanup
+
+- MakeMaker is a mess.  We like patches which clean things up.
+
+
+Backwards Compatibility
+
+- MakeMaker must be backwards compatible to 5.6.0.
+  Avoid any obvious 5.8-isms. 
+
+- MakeMaker should avoid having module dependencies.
+  But if new code need depends the modules absolutely,
+  it will bundle the modules.
+
+  See Makefile.PL of ExtUtils::MakeMaker for detail. 
+
+
+Cross-Platform Compatibility
+
+- MakeMaker must work on all architectures Perl works on (see perlport.pod).
+  This means all Unixen (including Cygwin and MacOS X), Windows, and VMS.
+
+- Use the available macros rather than shell commands $(MV), $(CP),
+  $(TOUCH), etc...
+
+- MakeMaker must work on many makes.  GNU, BSD, Solaris, nmake, dmake, MMS
+  and MMK to name the most common.  Keep your make code as simple as 
+  possible.  
+
+- Avoid special make variables (even $@).  
+
+- Format targets as "target : dependency", the spacing is important.  
+
+- Use $(NOECHO) instead of @.
+
+- Use - to tell make to ignore the exit code of a command.  (Unfortunately,
+  some make variants don't honor an $(IGNORE) macro).
+
+- Always put a space between $(NOECHO) and the command.
+
+- Always put a space between - (ignore) and the command.
+
+- Always put $(NOECHO) and - together, no space between them.
+
+        # Right
+        -$(NOECHO) command
+        $(NOECHO) command
+        - command
+
+- Often when you patch ExtUtils::MM_Unix, similar patches must be done
+  to the other MM_* modules.  If you can, please do this extra work
+  otherwise I have to.  If you can't, that's ok.  We can help.
+
+- If possible, please test your patch on two Very Different architectures.
+  Unix, Windows and VMS being Very Different.  Note: Cygwin and OS X are 
+  Unixen for our purposes.
+
+- If nothing else, at least try it on two different Unixen machines
+  (ie. Linux and OS X).
+
+- If you find yourself writing "do_this if $^O eq 'That'" (ie. checks on
+  the OS type) perhaps your code belongs in one of the non-Unix MM_*
+  modules (ie. MM_Win32, MM_VMS, etc...).  If one does not exist, consider
+  creating one.  Its ok to have an MM_* module with only one method.
+
+- Some shells have very small buffers.  This means command lines must
+  be as small as possible.  If your command is just too long, consider
+  making it an ExtUtils::Command::MM function.  If your command might
+  receive many arguments (such as pod2man or pm_to_blib) consider
+  using split_command() to split it into several, shorter calls.
+
+- Most shells quote differently.  If you need to put a perl one-liner
+  in the Makefile, please use oneliner() to generate it.
+
+
+Tests
+
+- Tests would be nice, but I'm not going to pretend testing MakeMaker
+  is easy.  If nothing else, let us know how you tested your patch by
+  hand.
+
+- Travis CI (https://travis-ci.org) is good sources of testing
+  machines of many perl versions.  Accounts are free.
+
+
+Documentation
+
+- Documentation would be nice.
+
+- If the new feature/method is private, please document it with POD
+  wrapped in "=begin/end private" tags.  That way it will be documented,
+  but won't be displayed (future versions of perldoc may have options
+  to display).
+
+    =begin private
+
+    =head3 _foo_bar
+
+       $mm->_foo_bar
+
+    Blah blah blah
+
+    =end private
+
+    =cut
+
+    sub _foo_bar {
+       ...
+
+- If you're overriding a method, document that its an override and
+  *why* its being overridden.  Don't repeat the original documentation.
@@ -1,3 +1,189 @@
+7.02 Sat Nov  8 07:13:40 GMT 2014
+
+    No changes from 7.01_09
+
+7.01_09 Thu Nov  6 21:41:32 GMT 2014
+    Test fixes:
+    - Marked a test in pm_to_blib.t as TODO until further
+      investigation can be scheduled
+
+7.01_08 Tue Nov  4 20:24:29 GMT 2014
+    Test fixes:
+    - roll back change in 7.01_07 and scrub PERL_INSTALL_QUIET
+      environment variable
+
+7.01_07 Tue Nov  4 19:26:46 GMT 2014
+    Test fixes:
+    - Changed a regex in pm_to_blib.t to be more forgiving
+
+7.01_06 Mon Nov  3 20:31:05 GMT 2014
+    Bug fixes:
+    - Resolved regression with TEST_FILES
+
+    Win32 fixes:
+    - Targetted fix for nmake bug
+    - miniperl.t core test fixed for Windows
+
+7.01_05 Mon Nov  3 10:14:11 GMT 2014
+    VMS fixes:
+    - Handle switches in $(PERL) by prepending MCR
+    - Don't quote MAKE on VMS in Test::Utils
+
+7.01_04 Fri Oct 31 09:38:06 GMT 2014
+    API change:
+    - writeMakefile() has been removed after 20 years of being deprecated
+
+    Bug fixes:
+    - Regression in xs.t with older versions of xsubpp has been resolved
+    - We now don't produce Borland C export symbols if BCC support dropped
+
+7.01_03 Thu Oct 30 19:12:57 GMT 2014
+    Bug fixes:
+    - Using NMAKE was broken this has been fixed
+
+7.01_02 Sat Oct 25 17:45:46 BST 2014
+    Bug fixes:
+    - Resolve a regression with FIXIN and core builds on Win32
+
+7.01_01 Sat Oct 25 13:45:00 BST 2014
+    Bug fixes:
+    - Resolve issue with Win32 perl builds in core
+
+7.00 Wed Oct 22 20:13:38 BST 2014
+
+    No changes from 6.99_18
+
+6.99_18 Mon Oct 20 10:02:58 BST 2014
+    Bug fixes:
+    - Resolve regression with taint and get_version() [RT#99580]
+
+    VMS fixes:
+    - Avoid .NOTPARALLEL on VMS as it is a syntax error for MMS and MMK
+    - Quotes are not stripped from argv[0] on VMS so need stripping
+    - Move MCR from PERL to PERLRUN on VMS and other *RUN variables
+
+6.99_17 Sun Oct 12 19:37:04 BST 2014
+    Bug fixes:
+    - Fix test that got broke under core since 6.99_15
+
+6.99_16 Thu Oct  2 19:29:49 BST 2014
+    Dist fixes:
+    - Move File::Copy::Recursive from bundled to where it is
+      used, so that it will not get installed as a runtime
+      prereq
+
+6.99_15 Sun Sep 21 13:21:46 BST 2014
+    Enhancements:
+    - If core, add ccwarnflags and ccstdflags, if available
+
+    Doc fixes:
+    - Fix internal links
+
+6.99_14 Fri Sep 19 14:59:08 BST 2014
+    Bug fixes:
+    - Fixes to fallback version module for core integration problems
+
+6.99_13 Mon Sep 15 20:02:47 BST 2014
+    Enhancements:
+    - Bundle Encode::Locale as ExtUtils::MakeMaker::Locale
+
+    Bug fixes:
+    - Make included version module have standardised dist versioning
+
+6.99_12 Thu Sep 11 15:27:31 BST 2014
+    Enhancements:
+    - Now include a fallback version module for bootstrapping
+
+    Bug fixes:
+    - Support libfoo.0.dylib style libraries on Darwin
+
+6.99_11 Mon Sep  8 14:20:26 BST 2014
+    Bug fixes:
+    - Handle chcp failure better on MSWin32
+    - Tests should be parallelisable once again
+
+    Doc fixes:
+    - Document that GNU make is usable on MSWin32 now
+
+6.99_10 Thu Sep  4 14:28:01 BST 2014
+    Bug fixes:
+    - Fixes for being integrated with core
+    - Fixed the code page reset on MSWin32
+    - Fixed test failures on BSD with UTF8 filenames
+    - Fixed regression with quoting of $(PERL) when
+      command line flags are used
+
+6.99_09 Thu Aug 28 11:01:37 BST 2014
+    Enhancements:
+    - Support GNU Make on Windows
+    - Support paths and filenames that are UTF8 encoded
+    - MM->can_run() added for finding programs (ported from
+      IPC::Cmd)
+
+    Bug fixes:
+    - Handle UTF8 when generating manpages correctly
+    - Generated Makefile contents are now consistently sorted
+
+6.99_08 Mon Aug 18 14:17:04 BST 2014
+    Bug fixes:
+    - Liblist::Kid: can now handle -l:foo.so invocations properly
+    - Scripts will no longer have the 'not running under some shell' code
+      applied when rewriting shebang lines.
+    - version is now used to parse prereqs versions internally
+    - Support UTF8 encoded command-line args and Makefile.PL args
+    - Generated META.files will now always have linefeed EOLs, even on
+      Windows
+    - Rewrite the version line eval handling to have less insane edge cases
+
+    Doc fixes:
+    - Documentation now includes links to Dist::Zilla, File::ShareDir and
+      File::ShareDir::Install
+    - Clarified support policy for < v5.8.1 in README
+
+    Misc:
+    - Updated bundled CPAN::Meta::Requirements to version 2.126
+    - Updated bundled ExtUtils::Manifest to version 1.65
+
+6.99_07 Wed Jul 30 17:36:14 BST 2014
+    Bug fixes:
+    - Resolve 'wide character in print' warnings
+
+6.99_06 Mon Jul 28 15:02:25 BST 2014
+    Enhancements:
+    - Improvements and tests for the spaces-in-stuff handling
+
+6.99_05 Tue Jul 22 12:32:03 BST 2014
+    Enhancements:
+    - Enable working with (including installing to) directories with spaces in names
+
+6.99_04 Sat Jul 12 12:43:08 BST 2014
+    Enhancements:
+    - No longer report each file being manified. Only summarise.
+
+6.99_03 Fri Jul  4 11:02:21 BST 2014
+    Doc Fixes:
+    - PATCHING document has been rewritten as CONTRIBUTING and TODO
+      document has been removed
+
+    Bug Fixes:
+    - Rearranged bundled prereqs so CPAN::Meta::Requirements won't
+      get stomped on if it is installed already, but CPAN::Meta isn't
+
+6.99_02 Thu Jun  5 12:15:28 BST 2014
+    Bug fixes:
+    * MM->parse_version will no longer warn if it could
+      not determine the $VERSION due to syntax errors etc.
+
+6.99_01 Tue Jun  3 22:17:30 BST 2014
+    Bug fixes:
+    * Disregard some warnings during tests when cross-compiling
+
+    Doc fixes:
+    * Clarified the use and limitations of META_ADD, META_MERGE
+
+    Test fixes:
+    * Sanitise env vars in tests
+
 6.98 Tue Apr 29 21:27:59 BST 2014
 
     No changes from 6.97_02
@@ -1,12 +1,12 @@
 .perlcriticrc
 bin/instmodsh
+bundled/CPAN-Meta-Requirements/CPAN/Meta/Requirements.pm
 bundled/CPAN-Meta-YAML/CPAN/Meta/YAML.pm
 bundled/CPAN-Meta/CPAN/Meta.pm
 bundled/CPAN-Meta/CPAN/Meta/Converter.pm
 bundled/CPAN-Meta/CPAN/Meta/Feature.pm
 bundled/CPAN-Meta/CPAN/Meta/History.pm
 bundled/CPAN-Meta/CPAN/Meta/Prereqs.pm
-bundled/CPAN-Meta/CPAN/Meta/Requirements.pm
 bundled/CPAN-Meta/CPAN/Meta/Spec.pm
 bundled/CPAN-Meta/CPAN/Meta/Validator.pm
 bundled/ExtUtils-Command/ExtUtils/Command.pm
@@ -15,7 +15,6 @@ bundled/ExtUtils-Install/ExtUtils/Installed.pm
 bundled/ExtUtils-Install/ExtUtils/Packlist.pm
 bundled/ExtUtils-Manifest/ExtUtils/Manifest.pm
 bundled/ExtUtils-Manifest/ExtUtils/MANIFEST.SKIP
-bundled/File-Copy-Recursive/File/Copy/Recursive.pm
 bundled/File-Temp/File/Temp.pm
 bundled/JSON-PP-Compat5006/JSON/PP/Compat5006.pm
 bundled/JSON-PP/JSON/PP.pm
@@ -26,11 +25,8 @@ bundled/Scalar-List-Utils/List/Util.pm
 bundled/Scalar-List-Utils/List/Util/PP.pm
 bundled/Scalar-List-Utils/Scalar/Util.pm
 bundled/Scalar-List-Utils/Scalar/Util/PP.pm
-bundled/version/version.pm
-bundled/version/version.pod
-bundled/version/version/Internals.pod
-bundled/version/version/vpp.pm
 Changes
+CONTRIBUTING
 INSTALL
 lib/ExtUtils/Command/MM.pm
 lib/ExtUtils/Liblist.pm
@@ -38,7 +34,11 @@ lib/ExtUtils/Liblist/Kid.pm
 lib/ExtUtils/MakeMaker.pm
 lib/ExtUtils/MakeMaker/Config.pm
 lib/ExtUtils/MakeMaker/FAQ.pod
+lib/ExtUtils/MakeMaker/Locale.pm
 lib/ExtUtils/MakeMaker/Tutorial.pod
+lib/ExtUtils/MakeMaker/version.pm
+lib/ExtUtils/MakeMaker/version/regex.pm
+lib/ExtUtils/MakeMaker/version/vpp.pm
 lib/ExtUtils/Mkbootstrap.pm
 lib/ExtUtils/Mksymlists.pm
 lib/ExtUtils/MM.pm
@@ -65,7 +65,6 @@ MANIFEST
 MANIFEST.SKIP
 my/bundles.pm
 NOTES
-PATCHING
 README
 README.packaging
 t/00compile.t
@@ -94,6 +93,7 @@ t/lib/MakeMaker/Test/Setup/PL_FILES.pm
 t/lib/MakeMaker/Test/Setup/Problem.pm
 t/lib/MakeMaker/Test/Setup/Recurs.pm
 t/lib/MakeMaker/Test/Setup/SAS.pm
+t/lib/MakeMaker/Test/Setup/Unicode.pm
 t/lib/MakeMaker/Test/Setup/XS.pm
 t/lib/MakeMaker/Test/Utils.pm
 t/lib/Test/Builder.pm
@@ -163,10 +163,11 @@ t/test_boilerplate.t
 t/testdata/reallylongdirectoryname/arch1/Config.pm
 t/testdata/reallylongdirectoryname/arch2/Config.pm
 t/testlib.t
+t/unicode.t
 t/VERSION_FROM.t
+t/vstrings.t
 t/WriteEmptyMakefile.t
 t/writemakefile_args.t
 t/xs.t
-TODO
 META.yml                                 Module YAML meta-data (added by MakeMaker)
 META.json                                Module JSON meta-data (added by MakeMaker)
@@ -4,7 +4,7 @@
       "Michael G Schwern <schwern@pobox.com>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351",
+   "generated_by" : "ExtUtils::MakeMaker version 7.02, CPAN::Meta::Converter version 2.120351",
    "license" : [
       "perl_5"
    ],
@@ -37,6 +37,7 @@
       "runtime" : {
          "requires" : {
             "DirHandle" : "0",
+            "Encode" : "0",
             "File::Basename" : "0",
             "File::Spec" : "0.8",
             "Pod::Man" : "0",
@@ -58,5 +59,5 @@
       },
       "x_MailingList" : "makemaker@perl.org"
    },
-   "version" : "6.98"
+   "version" : "7.02"
 }
@@ -6,7 +6,7 @@ build_requires:
   Data::Dumper: 0
 configure_requires: {}
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351'
+generated_by: 'ExtUtils::MakeMaker version 7.02, CPAN::Meta::Converter version 2.120351'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,6 +23,7 @@ no_index:
     - in
 requires:
   DirHandle: 0
+  Encode: 0
   File::Basename: 0
   File::Spec: 0.8
   Pod::Man: 0
@@ -33,4 +34,4 @@ resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker
   x_MailingList: makemaker@perl.org
-version: 6.98
+version: 7.02
@@ -55,12 +55,12 @@ if( $BUILDING_AS_PACKAGE ) {
         'CPAN::Meta::YAML'         => '0.002',
         'ExtUtils::Command'        => '1.16',
         'ExtUtils::Install'        => '1.52',
-        'ExtUtils::Manifest'       => '1.58',
+        'ExtUtils::Manifest'       => '1.65',
         'File::Temp'               => '0.22',
         'JSON::PP'                 => '2.27103',
         'Parse::CPAN::Meta'        => '1.4400',
         'Scalar::Util'             => '1.13',
-        'version'                  => '0.82',
+        'version'                  => '0',
         'CPAN::Meta::Requirements' => '2.121',
     );
 
@@ -94,6 +94,7 @@ my $MM = WriteMakefile(
         'Pod::Man'       => 0,                 # manifypods needs Pod::Man
         'File::Basename' => 0,
         DirHandle        => 0,
+        ($] > 5.008 ? (Encode => 0) : ()),
     },
 
     MIN_PERL_VERSION => '5.006',
@@ -242,6 +243,7 @@ END
 
     sub special_targets {
       my $make_frag = shift->SUPER::special_targets(@_);
+      return $make_frag if $Is_VMS; # not supported in MMS, MMK
       $make_frag .= <<'MAKE_FRAG';
 .NOTPARALLEL: pure_all
 
@@ -1,212 +0,0 @@
-"The easy way is always mined.
- The important things are always simple.
- The simple things are always hard."
-        -- Some of Murphy's Laws of Combat
-
-This is a short set of guidelines for those patching
-ExtUtils::MakeMaker.  Its not an iron-clad set of rules, but just
-things which make life easier when reading and integrating a patch.
-
-Lots of information can be found in makemaker.org.
-
-MakerMaker is being maintained until something else can replace it.
-Bugs will be fixed and compatibility improved, but I would like to
-avoid new features.  If you want to add something to MakeMaker,
-consider instead working on Module::Build, MakeMaker's heir apparent.
-
-
-Reporting bugs
-
-- Often the only information we have for fixing a bug is contained in your
-  report.  So...
-
-- Please report your bugs via http://rt.cpan.org or by mailing to
-  makemaker@perl.org.  RT is preferred.
-
-- Please report your bug immediately upon encountering it.  Do not wait
-  until you have a patch to fix the bug.  Patches are good, but not at
-  the expense of timely bug reports.
-
-- Please be as verbose as possible.  Include the complete output of
-  your 'make test' or even 'make test TEST_VERBOSE=1' and a copy of the 
-  generated Makefile.  Err on the side of verbosity.  The more data we
-  have to work with, the faster we can diagnose the problem.
-
-- If you find an undocumented feature, or if a feature has changed/been
-  added which causes a problem, report it.  Do not assume it was done
-  deliberately.  Even if it was done deliberately, we still want to hear
-  if it caused problems.
-
-- If you're testing MakeMaker against a development version of Perl,
-  please also check it against the latest stable version.  This makes it
-  easier to figure out if its MakeMaker or Perl at fault.
-
-
-Patching details
-
-- Please use unified diffs.  (diff -u)
-
-- Patches against the latest development snapshot from makemaker.org are 
-  preferred.  Patches against the latest CPAN version are ok, too.
-
-- Post your patch to makemaker@perl.org.
-
-
-Code formatting
-
-- No literal tabs (except where necessary inside Makefile code, obviously).
-
-- 4 character indentation.
-
-- this_style is prefered instead of studlyCaps.
-
-- Private subroutine names (ie. those used only in the same package
-  they're declared in) should start with an underscore (_sekret_method).
-
-- Protected subroutines (ie. ones intended to be used by other modules in
-  ExtUtils::*) should be named normally (no leading underscore) but
-  documented as protected (see Documentation below).
-
-- Do not use indirect object syntax (ie. new Foo::Bar (@args))
-
-- make variables use dollar signs like Perl scalars.  This causes problems
-  when you have to mix them both in a string.  If you find yourself
-  backwacking lots of dollar signs because you have one interpolated
-  perl variable, like this:
-
-    return <<EOT;
-subdirs ::
-	\$(NOECHO)cd $subdir && \$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
-
-EOT
-
-  or are switching quoting contexts:
-
-    return q{
-subdirs ::
-	$(NOECHO)cd }.$subdir.q{ && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
-
-};
-
-  consider using sprintf instead.
-
-    return sprintf <<'EOT', $subdir;
-subdirs ::
-	$(NOECHO)cd %s && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
-
-EOT
-
-
-Refactoring and Cleanup
-
-- MakeMaker is a mess.  We like patches which clean things up.
-
-
-Backwards Compatibility
-
-- MakeMaker must be backwards compatible to 5.5.4 (5.005_04).  Avoid any
-  obvious 5.6-isms (threads, warnings.pm, Unicode, our, v1.2.3, attributes
-  open my $fh, lvalue subroutines, qr//, any new core modules, etc...).
-
-- MakeMaker should avoid having module dependencies.  Avoid using modules
-  which didn't come with 5.5.4 and avoid using features from newer 
-  versions.  Sometimes this is unavoidable.
-
-
-Cross-Platform Compatibility
-
-- With the exception of MacOS Classic, MakeMaker must work on all 
-  architectures Perl works on (see perlport.pod).  This means all Unixen 
-  (including Cygwin and MacOS X), Windows (including Win9x and DOS), and VMS.
-
-- Use the available macros rather than shell commands $(MV), $(CP),
-  $(TOUCH), etc...
-
-- MakeMaker must work on many makes.  GNU, BSD, Solaris, nmake, dmake, MMS
-  and MMK to name the most common.  Keep your make code as simple as 
-  possible.  
-
-- Avoid special make variables (even $@).  
-
-- Format targets as "target : dependency", the spacing is important.  
-
-- Use $(NOECHO) instead of @.
-
-- Use - to tell make to ignore the exit code of a command.  (Unfortunately,
-  some make variants don't honor an $(IGNORE) macro).
-
-- Always put a space between $(NOECHO) and the command.
-
-- Always put a space between - (ignore) and the command.
-
-- Always put $(NOECHO) and - together, no space between them.
-
-        # Right
-        -$(NOECHO) command
-        $(NOECHO) command
-        - command
-
-- Often when you patch ExtUtils::MM_Unix, similar patches must be done
-  to the other MM_* modules.  If you can, please do this extra work
-  otherwise I have to.  If you can't, that's ok.  We can help.
-
-- If possible, please test your patch on two Very Different architectures.
-  Unix, Windows and VMS being Very Different.  Note: Cygwin and OS X are 
-  Unixen for our purposes.
-
-- If nothing else, at least try it on two different Unixen or Windows
-  machines (ie. Linux and IRIX or WinNT and Win95).
-
-- HP's TestDrive (www.testdrive.compaq.com) and SourceForge's
-  compile farm (www.sourceforge.net) are good sources of testing
-  machines of many different architectures and platforms.  Accounts are 
-  free.
-
-- If you find yourself writing "do_this if $^O eq 'That'" (ie. checks on
-  the OS type) perhaps your code belongs in one of the non-Unix MM_*
-  modules (ie. MM_Win32, MM_VMS, etc...).  If one does not exist, consider
-  creating one.  Its ok to have an MM_* module with only one method.
-
-- Some shells have very small buffers.  This means command lines must
-  be as small as possible.  If your command is just too long, consider
-  making it an ExtUtils::Command::MM function.  If your command might
-  receive many arguments (such as pod2man or pm_to_blib) consider
-  using split_command() to split it into several, shorter calls.
-
-- Most shells quote differently.  If you need to put a perl one-liner
-  in the Makefile, please use oneliner() to generate it.
-
-
-Tests
-
-- Tests would be nice, but I'm not going to pretend testing MakeMaker
-  is easy.  If nothing else, let us know how you tested your patch by
-  hand.
-
-
-Documentation
-
-- Documentation would be nice.
-
-- If the new feature/method is private, please document it with POD
-  wrapped in "=begin/end private" tags.  That way it will be documented,
-  but won't be displayed (future versions of perldoc may have options
-  to display).
-
-    =begin private
-
-    =head3 _foo_bar
-
-       $mm->_foo_bar
-
-    Blah blah blah
-
-    =end private
-
-    =cut
-
-    sub _foo_bar {
-       ...
-
-- If you're overriding a method, document that its an override and
-  *why* its being overridden.  Don't repeat the original documentation.
@@ -1,11 +1,20 @@
 This is a CPAN distribution of the venerable MakeMaker module.  It has been
 backported to work with Perl 5.6.0 and up.
 
+Please note that while this module works on Perl 5.6, it is no longer
+being routinely tested on 5.6. However, patches to repair any breakage
+on 5.6 are still being accepted.
+
 See INSTALL for installation instructions.  Run "perldoc
 ExtUtils::MakeMaker" (while in this source directory before
 installation) for more documentation.
 
-See http://rt.cpan.org for a full list of open problems.
+See http://rt.cpan.org or
+https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues
+for a full list of open problems.
 
-Please report any bugs via http://rt.cpan.org.
-Send questions and discussion to makemaker@perl.org
+Please report your bugs via http://rt.cpan.org or
+https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues or
+by mailing to makemaker@perl.org.
+  
+RT or GitHub are preferred.
@@ -1,78 +0,0 @@
-This TODO list is out of date.  See http://rt.cpan.org for the real list.
-
-
-Rethink MM_Win32 tests.
-
-Investigate one method per make target.
-
-Test MM_Any and pull some redundant tests out of MM_*.t
-
-Create a way to init MM objects.  (XXX What's wrong with MakeMaker->new?)
-
-Move instmodsh to utils/ in the core.
-
-Handle config files (ie. /etc) and their special PREFIX needs
-(ie. PREFIX=/usr, INSTALLCONFIGDIR=/etc).
-
-Make sure PDL builds
-
-Fix find_perl on Amiga trg@privat.utfors.se
-
-Fix appending of .. when DIRS contains directories not immediately
-below the cwd.
-
-Fill in the IMPORTS docs.
-
-Remove tar -I Sun-ism from instmodsh.
-
-Consider adding a timeout option to prompt() and env variable.
-
-Unify VMS->find_perl
-
-Consider if VMS->find_perl needs to have pieces put into maybe_command()
-
-Add a MM_Any->init_others() using ExtUtils::Command.
-
-Figure out and document the 4th arg to ExtUtils::Install::install()
-
-Consider if adding a nativize() routine to replace macify() and
-fixpath() is useful.
-
-Eliminate eliminate_macros() from inside FS::VMS->catfile and catdir.
-Make into MM_VMS wrappers.
-
-Test ExtUtils::Command::MM
-
-Finish ExtUtils::MakeMaker::Tutorial
-
-Add 'how to install additional files' to ExtUtils::MakeMaker::FAQ.
-
-Give typemap location its own macro.
-
-Merge MM_VMS->tool_xsubpp
-
-Initialize PERL_SRC to '' instead of leaving undef when outside the source 
-tree
-
-Reinstate HTMLification to use the new HTML Config info.
-
-split manifypods target into more generic docifypods target which depends on 
-manifypods
-
-Add target to generate native Win32 help files (or whatever Win32 likes
-to use for help files these days)
-
-Add target to generate native VMS help files.
-
-On VMS, write PM_FILTERs to a temp file and run from there avoiding command
-line lengths.  Worth the trouble given the Unixy nature of PM_FILTER?
-
-Move oneliner() and friends into a seperate module for general consumption.
-
-Make out of date check on 'make dist' more useful
-http://archive.develooper.com/makemaker@perl.org/msg01075.html
-
-Make maniadd() return a tied, case-insensitive hash on VMS.
-
-
-TER
\ No newline at end of file
@@ -6,9 +6,12 @@ our $VERSION = '2.120351'; # VERSION
 
 
 use CPAN::Meta::Validator;
-use version (); # Removed 0.82 constraint, EUMM installed CPAN::Meta
+BEGIN { eval "use version ()" || eval "use ExtUtils::MakeMaker::version ()" }
 use Parse::CPAN::Meta 1.4400 ();
 
+# Perl 5.10.0 didn't have "is_qv" in version.pm
+*_is_qv = version->can('is_qv') ? sub { $_[0]->is_qv } : sub { exists $_[0]->{qv} };
+
 sub _dclone {
   my $ref = shift;
 
@@ -320,7 +323,7 @@ sub _clean_version {
   # XXX check defined $v and not just $v because version objects leak memory
   # in boolean context -- dagolden, 2012-02-03
   if ( defined $v ) {
-    return $v->is_qv ? $v->normal : $element;
+    return _is_qv($v) ? $v->normal : $element;
   }
   else {
     return 0;
@@ -1,598 +0,0 @@
-use strict;
-use warnings;
-package CPAN::Meta::Requirements;
-our $VERSION = '2.120351'; # VERSION
-# ABSTRACT: a set of version requirements for a CPAN dist
-
-
-use Carp ();
-use Scalar::Util ();
-use version 0.77 (); # the ->parse method
-
-
-sub new {
-  my ($class) = @_;
-  return bless {} => $class;
-}
-
-sub _version_object {
-  my ($self, $version) = @_;
-
-  $version = (! defined $version)                ? version->parse(0)
-           : (! Scalar::Util::blessed($version)) ? version->parse($version)
-           :                                       $version;
-
-  return $version;
-}
-
-
-BEGIN {
-  for my $type (qw(minimum maximum exclusion exact_version)) {
-    my $method = "with_$type";
-    my $to_add = $type eq 'exact_version' ? $type : "add_$type";
-
-    my $code = sub {
-      my ($self, $name, $version) = @_;
-
-      $version = $self->_version_object( $version );
-
-      $self->__modify_entry_for($name, $method, $version);
-
-      return $self;
-    };
-    
-    no strict 'refs';
-    *$to_add = $code;
-  }
-}
-
-
-sub add_requirements {
-  my ($self, $req) = @_;
-
-  for my $module ($req->required_modules) {
-    my $modifiers = $req->__entry_for($module)->as_modifiers;
-    for my $modifier (@$modifiers) {
-      my ($method, @args) = @$modifier;
-      $self->$method($module => @args);
-    };
-  }
-
-  return $self;
-}
-
-
-sub accepts_module {
-  my ($self, $module, $version) = @_;
-
-  $version = $self->_version_object( $version );
-
-  return 1 unless my $range = $self->__entry_for($module);
-  return $range->_accepts($version);
-}
-
-
-sub clear_requirement {
-  my ($self, $module) = @_;
-
-  return $self unless $self->__entry_for($module);
-
-  Carp::confess("can't clear requirements on finalized requirements")
-    if $self->is_finalized;
-
-  delete $self->{requirements}{ $module };
-
-  return $self;
-}
-
-
-sub required_modules { keys %{ $_[0]{requirements} } }
-
-
-sub clone {
-  my ($self) = @_;
-  my $new = (ref $self)->new;
-
-  return $new->add_requirements($self);
-}
-
-sub __entry_for     { $_[0]{requirements}{ $_[1] } }
-
-sub __modify_entry_for {
-  my ($self, $name, $method, $version) = @_;
-
-  my $fin = $self->is_finalized;
-  my $old = $self->__entry_for($name);
-
-  Carp::confess("can't add new requirements to finalized requirements")
-    if $fin and not $old;
-
-  my $new = ($old || 'CPAN::Meta::Requirements::_Range::Range')
-          ->$method($version);
-
-  Carp::confess("can't modify finalized requirements")
-    if $fin and $old->as_string ne $new->as_string;
-
-  $self->{requirements}{ $name } = $new;
-}
-
-
-sub is_simple {
-  my ($self) = @_;
-  for my $module ($self->required_modules) {
-    # XXX: This is a complete hack, but also entirely correct.
-    return if $self->__entry_for($module)->as_string =~ /\s/;
-  }
-
-  return 1;
-}
-
-
-sub is_finalized { $_[0]{finalized} }
-
-
-sub finalize { $_[0]{finalized} = 1 }
-
-
-sub as_string_hash {
-  my ($self) = @_;
-
-  my %hash = map {; $_ => $self->{requirements}{$_}->as_string }
-             $self->required_modules;
-
-  return \%hash;
-}
-
-
-my %methods_for_op = (
-  '==' => [ qw(exact_version) ],
-  '!=' => [ qw(add_exclusion) ],
-  '>=' => [ qw(add_minimum)   ],
-  '<=' => [ qw(add_maximum)   ],
-  '>'  => [ qw(add_minimum add_exclusion) ],
-  '<'  => [ qw(add_maximum add_exclusion) ],
-);
-
-sub from_string_hash {
-  my ($class, $hash) = @_;
-
-  my $self = $class->new;
-
-  for my $module (keys %$hash) {
-    my @parts = split qr{\s*,\s*}, $hash->{ $module };
-    for my $part (@parts) {
-      my ($op, $ver) = split /\s+/, $part, 2;
-
-      if (! defined $ver) {
-        $self->add_minimum($module => $op);
-      } else {
-        Carp::confess("illegal requirement string: $hash->{ $module }")
-          unless my $methods = $methods_for_op{ $op };
-
-        $self->$_($module => $ver) for @$methods;
-      }
-    }
-  }
-
-  return $self;
-}
-
-##############################################################
-
-{
-  package
-    CPAN::Meta::Requirements::_Range::Exact;
-  sub _new     { bless { version => $_[1] } => $_[0] }
-
-  sub _accepts { return $_[0]{version} == $_[1] }
-
-  sub as_string { return "== $_[0]{version}" }
-
-  sub as_modifiers { return [ [ exact_version => $_[0]{version} ] ] }
-
-  sub _clone {
-    (ref $_[0])->_new( version->new( $_[0]{version} ) )
-  }
-
-  sub with_exact_version {
-    my ($self, $version) = @_;
-
-    return $self->_clone if $self->_accepts($version);
-
-    Carp::confess("illegal requirements: unequal exact version specified");
-  }
-
-  sub with_minimum {
-    my ($self, $minimum) = @_;
-    return $self->_clone if $self->{version} >= $minimum;
-    Carp::confess("illegal requirements: minimum above exact specification");
-  }
-
-  sub with_maximum {
-    my ($self, $maximum) = @_;
-    return $self->_clone if $self->{version} <= $maximum;
-    Carp::confess("illegal requirements: maximum below exact specification");
-  }
-
-  sub with_exclusion {
-    my ($self, $exclusion) = @_;
-    return $self->_clone unless $exclusion == $self->{version};
-    Carp::confess("illegal requirements: excluded exact specification");
-  }
-}
-
-##############################################################
-
-{
-  package
-    CPAN::Meta::Requirements::_Range::Range;
-
-  sub _self { ref($_[0]) ? $_[0] : (bless { } => $_[0]) }
-
-  sub _clone {
-    return (bless { } => $_[0]) unless ref $_[0];
-
-    my ($s) = @_;
-    my %guts = (
-      (exists $s->{minimum} ? (minimum => version->new($s->{minimum})) : ()),
-      (exists $s->{maximum} ? (maximum => version->new($s->{maximum})) : ()),
-
-      (exists $s->{exclusions}
-        ? (exclusions => [ map { version->new($_) } @{ $s->{exclusions} } ])
-        : ()),
-    );
-
-    bless \%guts => ref($s);
-  }
-
-  sub as_modifiers {
-    my ($self) = @_;
-    my @mods;
-    push @mods, [ add_minimum => $self->{minimum} ] if exists $self->{minimum};
-    push @mods, [ add_maximum => $self->{maximum} ] if exists $self->{maximum};
-    push @mods, map {; [ add_exclusion => $_ ] } @{$self->{exclusions} || []};
-    return \@mods;
-  }
-
-  sub as_string {
-    my ($self) = @_;
-
-    return 0 if ! keys %$self;
-
-    return "$self->{minimum}" if (keys %$self) == 1 and exists $self->{minimum};
-
-    my @exclusions = @{ $self->{exclusions} || [] };
-
-    my @parts;
-
-    for my $pair (
-      [ qw( >= > minimum ) ],
-      [ qw( <= < maximum ) ],
-    ) {
-      my ($op, $e_op, $k) = @$pair;
-      if (exists $self->{$k}) {
-        my @new_exclusions = grep { $_ != $self->{ $k } } @exclusions;
-        if (@new_exclusions == @exclusions) {
-          push @parts, "$op $self->{ $k }";
-        } else {
-          push @parts, "$e_op $self->{ $k }";
-          @exclusions = @new_exclusions;
-        }
-      }
-    }
-
-    push @parts, map {; "!= $_" } @exclusions;
-
-    return join q{, }, @parts;
-  }
-
-  sub with_exact_version {
-    my ($self, $version) = @_;
-    $self = $self->_clone;
-
-    Carp::confess("illegal requirements: exact specification outside of range")
-      unless $self->_accepts($version);
-
-    return CPAN::Meta::Requirements::_Range::Exact->_new($version);
-  }
-
-  sub _simplify {
-    my ($self) = @_;
-
-    if (defined $self->{minimum} and defined $self->{maximum}) {
-      if ($self->{minimum} == $self->{maximum}) {
-        Carp::confess("illegal requirements: excluded all values")
-          if grep { $_ == $self->{minimum} } @{ $self->{exclusions} || [] };
-
-        return CPAN::Meta::Requirements::_Range::Exact->_new($self->{minimum})
-      }
-
-      Carp::confess("illegal requirements: minimum exceeds maximum")
-        if $self->{minimum} > $self->{maximum};
-    }
-
-    # eliminate irrelevant exclusions
-    if ($self->{exclusions}) {
-      my %seen;
-      @{ $self->{exclusions} } = grep {
-        (! defined $self->{minimum} or $_ >= $self->{minimum})
-        and
-        (! defined $self->{maximum} or $_ <= $self->{maximum})
-        and
-        ! $seen{$_}++
-      } @{ $self->{exclusions} };
-    }
-
-    return $self;
-  }
-
-  sub with_minimum {
-    my ($self, $minimum) = @_;
-    $self = $self->_clone;
-
-    if (defined (my $old_min = $self->{minimum})) {
-      $self->{minimum} = (sort { $b cmp $a } ($minimum, $old_min))[0];
-    } else {
-      $self->{minimum} = $minimum;
-    }
-
-    return $self->_simplify;
-  }
-
-  sub with_maximum {
-    my ($self, $maximum) = @_;
-    $self = $self->_clone;
-
-    if (defined (my $old_max = $self->{maximum})) {
-      $self->{maximum} = (sort { $a cmp $b } ($maximum, $old_max))[0];
-    } else {
-      $self->{maximum} = $maximum;
-    }
-
-    return $self->_simplify;
-  }
-
-  sub with_exclusion {
-    my ($self, $exclusion) = @_;
-    $self = $self->_clone;
-
-    push @{ $self->{exclusions} ||= [] }, $exclusion;
-
-    return $self->_simplify;
-  }
-
-  sub _accepts {
-    my ($self, $version) = @_;
-
-    return if defined $self->{minimum} and $version < $self->{minimum};
-    return if defined $self->{maximum} and $version > $self->{maximum};
-    return if defined $self->{exclusions}
-          and grep { $version == $_ } @{ $self->{exclusions} };
-
-    return 1;
-  }
-}
-
-1;
-
-__END__
-=pod
-
-=head1 NAME
-
-CPAN::Meta::Requirements - a set of version requirements for a CPAN dist
-
-=head1 VERSION
-
-version 2.120351
-
-=head1 SYNOPSIS
-
-  use CPAN::Meta::Requirements;
-
-  my $build_requires = CPAN::Meta::Requirements->new;
-
-  $build_requires->add_minimum('Library::Foo' => 1.208);
-
-  $build_requires->add_minimum('Library::Foo' => 2.602);
-
-  $build_requires->add_minimum('Module::Bar'  => 'v1.2.3');
-
-  $METAyml->{build_requires} = $build_requires->as_string_hash;
-
-=head1 DESCRIPTION
-
-A CPAN::Meta::Requirements object models a set of version constraints like
-those specified in the F<META.yml> or F<META.json> files in CPAN distributions.
-It can be built up by adding more and more constraints, and it will reduce them
-to the simplest representation.
-
-Logically impossible constraints will be identified immediately by thrown
-exceptions.
-
-=head1 METHODS
-
-=head2 new
-
-  my $req = CPAN::Meta::Requirements->new;
-
-This returns a new CPAN::Meta::Requirements object.  It ignores any arguments
-given.
-
-=head2 add_minimum
-
-  $req->add_minimum( $module => $version );
-
-This adds a new minimum version requirement.  If the new requirement is
-redundant to the existing specification, this has no effect.
-
-Minimum requirements are inclusive.  C<$version> is required, along with any
-greater version number.
-
-This method returns the requirements object.
-
-=head2 add_maximum
-
-  $req->add_maximum( $module => $version );
-
-This adds a new maximum version requirement.  If the new requirement is
-redundant to the existing specification, this has no effect.
-
-Maximum requirements are inclusive.  No version strictly greater than the given
-version is allowed.
-
-This method returns the requirements object.
-
-=head2 add_exclusion
-
-  $req->add_exclusion( $module => $version );
-
-This adds a new excluded version.  For example, you might use these three
-method calls:
-
-  $req->add_minimum( $module => '1.00' );
-  $req->add_maximum( $module => '1.82' );
-
-  $req->add_exclusion( $module => '1.75' );
-
-Any version between 1.00 and 1.82 inclusive would be acceptable, except for
-1.75.
-
-This method returns the requirements object.
-
-=head2 exact_version
-
-  $req->exact_version( $module => $version );
-
-This sets the version required for the given module to I<exactly> the given
-version.  No other version would be considered acceptable.
-
-This method returns the requirements object.
-
-=head2 add_requirements
-
-  $req->add_requirements( $another_req_object );
-
-This method adds all the requirements in the given CPAN::Meta::Requirements object
-to the requirements object on which it was called.  If there are any conflicts,
-an exception is thrown.
-
-This method returns the requirements object.
-
-=head2 accepts_module
-
-  my $bool = $req->accepts_modules($module => $version);
-
-Given an module and version, this method returns true if the version
-specification for the module accepts the provided version.  In other words,
-given:
-
-  Module => '>= 1.00, < 2.00'
-
-We will accept 1.00 and 1.75 but not 0.50 or 2.00.
-
-For modules that do not appear in the requirements, this method will return
-true.
-
-=head2 clear_requirement
-
-  $req->clear_requirement( $module );
-
-This removes the requirement for a given module from the object.
-
-This method returns the requirements object.
-
-=head2 required_modules
-
-This method returns a list of all the modules for which requirements have been
-specified.
-
-=head2 clone
-
-  $req->clone;
-
-This method returns a clone of the invocant.  The clone and the original object
-can then be changed independent of one another.
-
-=head2 is_simple
-
-This method returns true if and only if all requirements are inclusive minimums
--- that is, if their string expression is just the version number.
-
-=head2 is_finalized
-
-This method returns true if the requirements have been finalized by having the
-C<finalize> method called on them.
-
-=head2 finalize
-
-This method marks the requirements finalized.  Subsequent attempts to change
-the requirements will be fatal, I<if> they would result in a change.  If they
-would not alter the requirements, they have no effect.
-
-If a finalized set of requirements is cloned, the cloned requirements are not
-also finalized.
-
-=head2 as_string_hash
-
-This returns a reference to a hash describing the requirements using the
-strings in the F<META.yml> specification.
-
-For example after the following program:
-
-  my $req = CPAN::Meta::Requirements->new;
-
-  $req->add_minimum('CPAN::Meta::Requirements' => 0.102);
-
-  $req->add_minimum('Library::Foo' => 1.208);
-
-  $req->add_maximum('Library::Foo' => 2.602);
-
-  $req->add_minimum('Module::Bar'  => 'v1.2.3');
-
-  $req->add_exclusion('Module::Bar'  => 'v1.2.8');
-
-  $req->exact_version('Xyzzy'  => '6.01');
-
-  my $hashref = $req->as_string_hash;
-
-C<$hashref> would contain:
-
-  {
-    'CPAN::Meta::Requirements' => '0.102',
-    'Library::Foo' => '>= 1.208, <= 2.206',
-    'Module::Bar'  => '>= v1.2.3, != v1.2.8',
-    'Xyzzy'        => '== 6.01',
-  }
-
-=head2 from_string_hash
-
-  my $req = CPAN::Meta::Requirements->from_string_hash( \%hash );
-
-This is an alternate constructor for a CPAN::Meta::Requirements object.  It takes
-a hash of module names and version requirement strings and returns a new
-CPAN::Meta::Requirements object.
-
-=head1 AUTHORS
-
-=over 4
-
-=item *
-
-David Golden <dagolden@cpan.org>
-
-=item *
-
-Ricardo Signes <rjbs@cpan.org>
-
-=back
-
-=head1 COPYRIGHT AND LICENSE
-
-This software is copyright (c) 2010 by David Golden and Ricardo Signes.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-=cut
-
@@ -0,0 +1,1030 @@
+use strict;
+use warnings;
+package CPAN::Meta::Requirements;
+our $VERSION = '2.127'; # VERSION
+# ABSTRACT: a set of version requirements for a CPAN dist
+
+#pod =head1 SYNOPSIS
+#pod
+#pod   use CPAN::Meta::Requirements;
+#pod
+#pod   my $build_requires = CPAN::Meta::Requirements->new;
+#pod
+#pod   $build_requires->add_minimum('Library::Foo' => 1.208);
+#pod
+#pod   $build_requires->add_minimum('Library::Foo' => 2.602);
+#pod
+#pod   $build_requires->add_minimum('Module::Bar'  => 'v1.2.3');
+#pod
+#pod   $METAyml->{build_requires} = $build_requires->as_string_hash;
+#pod
+#pod =head1 DESCRIPTION
+#pod
+#pod A CPAN::Meta::Requirements object models a set of version constraints like
+#pod those specified in the F<META.yml> or F<META.json> files in CPAN distributions,
+#pod and as defined by L<CPAN::Meta::Spec>;
+#pod It can be built up by adding more and more constraints, and it will reduce them
+#pod to the simplest representation.
+#pod
+#pod Logically impossible constraints will be identified immediately by thrown
+#pod exceptions.
+#pod
+#pod =cut
+
+use Carp ();
+use Scalar::Util ();
+
+# To help ExtUtils::MakeMaker bootstrap CPAN::Meta::Requirements on perls
+# before 5.10, we fall back to the EUMM bundled compatibility version module if
+# that's the only thing available.  This shouldn't ever happen in a normal CPAN
+# install of CPAN::Meta::Requirements, as version.pm will be picked up from
+# prereqs and be available at runtime.
+
+BEGIN { eval "use version ()" or eval "use ExtUtils::MakeMaker::version" } ## no critic
+
+# Perl 5.10.0 didn't have "is_qv" in version.pm
+*_is_qv = version->can('is_qv') ? sub { $_[0]->is_qv } : sub { exists $_[0]->{qv} };
+
+#pod =method new
+#pod
+#pod   my $req = CPAN::Meta::Requirements->new;
+#pod
+#pod This returns a new CPAN::Meta::Requirements object.  It takes an optional
+#pod hash reference argument.  Currently, only one key is supported:
+#pod
+#pod =for :list
+#pod * C<bad_version_hook> -- if provided, when a version cannot be parsed into
+#pod   a version object, this code reference will be called with the invalid version
+#pod   string as an argument.  It must return a valid version object.
+#pod
+#pod All other keys are ignored.
+#pod
+#pod =cut
+
+my @valid_options = qw( bad_version_hook );
+
+sub new {
+  my ($class, $options) = @_;
+  $options ||= {};
+  Carp::croak "Argument to $class\->new() must be a hash reference"
+    unless ref $options eq 'HASH';
+  my %self = map {; $_ => $options->{$_}} @valid_options;
+
+  return bless \%self => $class;
+}
+
+# from version::vpp
+sub _find_magic_vstring {
+  my $value = shift;
+  my $tvalue = '';
+  require B;
+  my $sv = B::svref_2object(\$value);
+  my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
+  while ( $magic ) {
+    if ( $magic->TYPE eq 'V' ) {
+      $tvalue = $magic->PTR;
+      $tvalue =~ s/^v?(.+)$/v$1/;
+      last;
+    }
+    else {
+      $magic = $magic->MOREMAGIC;
+    }
+  }
+  return $tvalue;
+}
+
+sub _version_object {
+  my ($self, $version) = @_;
+
+  my $vobj;
+
+  # hack around version::vpp not handling <3 character vstring literals
+  if ( $INC{'version/vpp.pm'} || $INC{'ExtUtils/MakeMaker/version/vpp.pm'} ) {
+    my $magic = _find_magic_vstring( $version );
+    $version = $magic if length $magic;
+  }
+
+  eval {
+    local $SIG{__WARN__} = sub { die "Invalid version: $_[0]" };
+    $vobj  = (! defined $version)                ? version->new(0)
+           : (! Scalar::Util::blessed($version)) ? version->new($version)
+           :                                       $version;
+  };
+
+  if ( my $err = $@ ) {
+    my $hook = $self->{bad_version_hook};
+    $vobj = eval { $hook->($version) }
+      if ref $hook eq 'CODE';
+    unless (Scalar::Util::blessed($vobj) && $vobj->isa("version")) {
+      $err =~ s{ at .* line \d+.*$}{};
+      die "Can't convert '$version': $err";
+    }
+  }
+
+  # ensure no leading '.'
+  if ( $vobj =~ m{\A\.} ) {
+    $vobj = version->new("0$vobj");
+  }
+
+  # ensure normal v-string form
+  if ( _is_qv($vobj) ) {
+    $vobj = version->new($vobj->normal);
+  }
+
+  return $vobj;
+}
+
+#pod =method add_minimum
+#pod
+#pod   $req->add_minimum( $module => $version );
+#pod
+#pod This adds a new minimum version requirement.  If the new requirement is
+#pod redundant to the existing specification, this has no effect.
+#pod
+#pod Minimum requirements are inclusive.  C<$version> is required, along with any
+#pod greater version number.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =method add_maximum
+#pod
+#pod   $req->add_maximum( $module => $version );
+#pod
+#pod This adds a new maximum version requirement.  If the new requirement is
+#pod redundant to the existing specification, this has no effect.
+#pod
+#pod Maximum requirements are inclusive.  No version strictly greater than the given
+#pod version is allowed.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =method add_exclusion
+#pod
+#pod   $req->add_exclusion( $module => $version );
+#pod
+#pod This adds a new excluded version.  For example, you might use these three
+#pod method calls:
+#pod
+#pod   $req->add_minimum( $module => '1.00' );
+#pod   $req->add_maximum( $module => '1.82' );
+#pod
+#pod   $req->add_exclusion( $module => '1.75' );
+#pod
+#pod Any version between 1.00 and 1.82 inclusive would be acceptable, except for
+#pod 1.75.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =method exact_version
+#pod
+#pod   $req->exact_version( $module => $version );
+#pod
+#pod This sets the version required for the given module to I<exactly> the given
+#pod version.  No other version would be considered acceptable.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =cut
+
+BEGIN {
+  for my $type (qw(minimum maximum exclusion exact_version)) {
+    my $method = "with_$type";
+    my $to_add = $type eq 'exact_version' ? $type : "add_$type";
+
+    my $code = sub {
+      my ($self, $name, $version) = @_;
+
+      $version = $self->_version_object( $version );
+
+      $self->__modify_entry_for($name, $method, $version);
+
+      return $self;
+    };
+    
+    no strict 'refs';
+    *$to_add = $code;
+  }
+}
+
+#pod =method add_requirements
+#pod
+#pod   $req->add_requirements( $another_req_object );
+#pod
+#pod This method adds all the requirements in the given CPAN::Meta::Requirements object
+#pod to the requirements object on which it was called.  If there are any conflicts,
+#pod an exception is thrown.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =cut
+
+sub add_requirements {
+  my ($self, $req) = @_;
+
+  for my $module ($req->required_modules) {
+    my $modifiers = $req->__entry_for($module)->as_modifiers;
+    for my $modifier (@$modifiers) {
+      my ($method, @args) = @$modifier;
+      $self->$method($module => @args);
+    };
+  }
+
+  return $self;
+}
+
+#pod =method accepts_module
+#pod
+#pod   my $bool = $req->accepts_module($module => $version);
+#pod
+#pod Given an module and version, this method returns true if the version
+#pod specification for the module accepts the provided version.  In other words,
+#pod given:
+#pod
+#pod   Module => '>= 1.00, < 2.00'
+#pod
+#pod We will accept 1.00 and 1.75 but not 0.50 or 2.00.
+#pod
+#pod For modules that do not appear in the requirements, this method will return
+#pod true.
+#pod
+#pod =cut
+
+sub accepts_module {
+  my ($self, $module, $version) = @_;
+
+  $version = $self->_version_object( $version );
+
+  return 1 unless my $range = $self->__entry_for($module);
+  return $range->_accepts($version);
+}
+
+#pod =method clear_requirement
+#pod
+#pod   $req->clear_requirement( $module );
+#pod
+#pod This removes the requirement for a given module from the object.
+#pod
+#pod This method returns the requirements object.
+#pod
+#pod =cut
+
+sub clear_requirement {
+  my ($self, $module) = @_;
+
+  return $self unless $self->__entry_for($module);
+
+  Carp::confess("can't clear requirements on finalized requirements")
+    if $self->is_finalized;
+
+  delete $self->{requirements}{ $module };
+
+  return $self;
+}
+
+#pod =method requirements_for_module
+#pod
+#pod   $req->requirements_for_module( $module );
+#pod
+#pod This returns a string containing the version requirements for a given module in
+#pod the format described in L<CPAN::Meta::Spec> or undef if the given module has no
+#pod requirements. This should only be used for informational purposes such as error
+#pod messages and should not be interpreted or used for comparison (see
+#pod L</accepts_module> instead.)
+#pod
+#pod =cut
+
+sub requirements_for_module {
+  my ($self, $module) = @_;
+  my $entry = $self->__entry_for($module);
+  return unless $entry;
+  return $entry->as_string;
+}
+
+#pod =method required_modules
+#pod
+#pod This method returns a list of all the modules for which requirements have been
+#pod specified.
+#pod
+#pod =cut
+
+sub required_modules { keys %{ $_[0]{requirements} } }
+
+#pod =method clone
+#pod
+#pod   $req->clone;
+#pod
+#pod This method returns a clone of the invocant.  The clone and the original object
+#pod can then be changed independent of one another.
+#pod
+#pod =cut
+
+sub clone {
+  my ($self) = @_;
+  my $new = (ref $self)->new;
+
+  return $new->add_requirements($self);
+}
+
+sub __entry_for     { $_[0]{requirements}{ $_[1] } }
+
+sub __modify_entry_for {
+  my ($self, $name, $method, $version) = @_;
+
+  my $fin = $self->is_finalized;
+  my $old = $self->__entry_for($name);
+
+  Carp::confess("can't add new requirements to finalized requirements")
+    if $fin and not $old;
+
+  my $new = ($old || 'CPAN::Meta::Requirements::_Range::Range')
+          ->$method($version);
+
+  Carp::confess("can't modify finalized requirements")
+    if $fin and $old->as_string ne $new->as_string;
+
+  $self->{requirements}{ $name } = $new;
+}
+
+#pod =method is_simple
+#pod
+#pod This method returns true if and only if all requirements are inclusive minimums
+#pod -- that is, if their string expression is just the version number.
+#pod
+#pod =cut
+
+sub is_simple {
+  my ($self) = @_;
+  for my $module ($self->required_modules) {
+    # XXX: This is a complete hack, but also entirely correct.
+    return if $self->__entry_for($module)->as_string =~ /\s/;
+  }
+
+  return 1;
+}
+
+#pod =method is_finalized
+#pod
+#pod This method returns true if the requirements have been finalized by having the
+#pod C<finalize> method called on them.
+#pod
+#pod =cut
+
+sub is_finalized { $_[0]{finalized} }
+
+#pod =method finalize
+#pod
+#pod This method marks the requirements finalized.  Subsequent attempts to change
+#pod the requirements will be fatal, I<if> they would result in a change.  If they
+#pod would not alter the requirements, they have no effect.
+#pod
+#pod If a finalized set of requirements is cloned, the cloned requirements are not
+#pod also finalized.
+#pod
+#pod =cut
+
+sub finalize { $_[0]{finalized} = 1 }
+
+#pod =method as_string_hash
+#pod
+#pod This returns a reference to a hash describing the requirements using the
+#pod strings in the L<CPAN::Meta::Spec> specification.
+#pod
+#pod For example after the following program:
+#pod
+#pod   my $req = CPAN::Meta::Requirements->new;
+#pod
+#pod   $req->add_minimum('CPAN::Meta::Requirements' => 0.102);
+#pod
+#pod   $req->add_minimum('Library::Foo' => 1.208);
+#pod
+#pod   $req->add_maximum('Library::Foo' => 2.602);
+#pod
+#pod   $req->add_minimum('Module::Bar'  => 'v1.2.3');
+#pod
+#pod   $req->add_exclusion('Module::Bar'  => 'v1.2.8');
+#pod
+#pod   $req->exact_version('Xyzzy'  => '6.01');
+#pod
+#pod   my $hashref = $req->as_string_hash;
+#pod
+#pod C<$hashref> would contain:
+#pod
+#pod   {
+#pod     'CPAN::Meta::Requirements' => '0.102',
+#pod     'Library::Foo' => '>= 1.208, <= 2.206',
+#pod     'Module::Bar'  => '>= v1.2.3, != v1.2.8',
+#pod     'Xyzzy'        => '== 6.01',
+#pod   }
+#pod
+#pod =cut
+
+sub as_string_hash {
+  my ($self) = @_;
+
+  my %hash = map {; $_ => $self->{requirements}{$_}->as_string }
+             $self->required_modules;
+
+  return \%hash;
+}
+
+#pod =method add_string_requirement
+#pod
+#pod   $req->add_string_requirement('Library::Foo' => '>= 1.208, <= 2.206');
+#pod
+#pod This method parses the passed in string and adds the appropriate requirement
+#pod for the given module.  It understands version ranges as described in the
+#pod L<CPAN::Meta::Spec/Version Ranges>. For example:
+#pod
+#pod =over 4
+#pod
+#pod =item 1.3
+#pod
+#pod =item >= 1.3
+#pod
+#pod =item <= 1.3
+#pod
+#pod =item == 1.3
+#pod
+#pod =item != 1.3
+#pod
+#pod =item > 1.3
+#pod
+#pod =item < 1.3
+#pod
+#pod =item >= 1.3, != 1.5, <= 2.0
+#pod
+#pod A version number without an operator is equivalent to specifying a minimum
+#pod (C<E<gt>=>).  Extra whitespace is allowed.
+#pod
+#pod =back
+#pod
+#pod =cut
+
+my %methods_for_op = (
+  '==' => [ qw(exact_version) ],
+  '!=' => [ qw(add_exclusion) ],
+  '>=' => [ qw(add_minimum)   ],
+  '<=' => [ qw(add_maximum)   ],
+  '>'  => [ qw(add_minimum add_exclusion) ],
+  '<'  => [ qw(add_maximum add_exclusion) ],
+);
+
+sub add_string_requirement {
+  my ($self, $module, $req) = @_;
+
+  Carp::confess("No requirement string provided for $module")
+    unless defined $req && length $req;
+
+  my @parts = split qr{\s*,\s*}, $req;
+
+
+  for my $part (@parts) {
+    my ($op, $ver) = $part =~ m{\A\s*(==|>=|>|<=|<|!=)\s*(.*)\z};
+
+    if (! defined $op) {
+      $self->add_minimum($module => $part);
+    } else {
+      Carp::confess("illegal requirement string: $req")
+        unless my $methods = $methods_for_op{ $op };
+
+      $self->$_($module => $ver) for @$methods;
+    }
+  }
+}
+
+#pod =method from_string_hash
+#pod
+#pod   my $req = CPAN::Meta::Requirements->from_string_hash( \%hash );
+#pod
+#pod This is an alternate constructor for a CPAN::Meta::Requirements object.  It takes
+#pod a hash of module names and version requirement strings and returns a new
+#pod CPAN::Meta::Requirements object.
+#pod
+#pod =cut
+
+sub from_string_hash {
+  my ($class, $hash) = @_;
+
+  my $self = $class->new;
+
+  for my $module (keys %$hash) {
+    my $req = $hash->{$module};
+    unless ( defined $req && length $req ) {
+      $req = 0;
+      Carp::carp("Undefined requirement for $module treated as '0'");
+    }
+    $self->add_string_requirement($module, $req);
+  }
+
+  return $self;
+}
+
+##############################################################
+
+{
+  package
+    CPAN::Meta::Requirements::_Range::Exact;
+  sub _new     { bless { version => $_[1] } => $_[0] }
+
+  sub _accepts { return $_[0]{version} == $_[1] }
+
+  sub as_string { return "== $_[0]{version}" }
+
+  sub as_modifiers { return [ [ exact_version => $_[0]{version} ] ] }
+
+  sub _clone {
+    (ref $_[0])->_new( version->new( $_[0]{version} ) )
+  }
+
+  sub with_exact_version {
+    my ($self, $version) = @_;
+
+    return $self->_clone if $self->_accepts($version);
+
+    Carp::confess("illegal requirements: unequal exact version specified");
+  }
+
+  sub with_minimum {
+    my ($self, $minimum) = @_;
+    return $self->_clone if $self->{version} >= $minimum;
+    Carp::confess("illegal requirements: minimum above exact specification");
+  }
+
+  sub with_maximum {
+    my ($self, $maximum) = @_;
+    return $self->_clone if $self->{version} <= $maximum;
+    Carp::confess("illegal requirements: maximum below exact specification");
+  }
+
+  sub with_exclusion {
+    my ($self, $exclusion) = @_;
+    return $self->_clone unless $exclusion == $self->{version};
+    Carp::confess("illegal requirements: excluded exact specification");
+  }
+}
+
+##############################################################
+
+{
+  package
+    CPAN::Meta::Requirements::_Range::Range;
+
+  sub _self { ref($_[0]) ? $_[0] : (bless { } => $_[0]) }
+
+  sub _clone {
+    return (bless { } => $_[0]) unless ref $_[0];
+
+    my ($s) = @_;
+    my %guts = (
+      (exists $s->{minimum} ? (minimum => version->new($s->{minimum})) : ()),
+      (exists $s->{maximum} ? (maximum => version->new($s->{maximum})) : ()),
+
+      (exists $s->{exclusions}
+        ? (exclusions => [ map { version->new($_) } @{ $s->{exclusions} } ])
+        : ()),
+    );
+
+    bless \%guts => ref($s);
+  }
+
+  sub as_modifiers {
+    my ($self) = @_;
+    my @mods;
+    push @mods, [ add_minimum => $self->{minimum} ] if exists $self->{minimum};
+    push @mods, [ add_maximum => $self->{maximum} ] if exists $self->{maximum};
+    push @mods, map {; [ add_exclusion => $_ ] } @{$self->{exclusions} || []};
+    return \@mods;
+  }
+
+  sub as_string {
+    my ($self) = @_;
+
+    return 0 if ! keys %$self;
+
+    return "$self->{minimum}" if (keys %$self) == 1 and exists $self->{minimum};
+
+    my @exclusions = @{ $self->{exclusions} || [] };
+
+    my @parts;
+
+    for my $pair (
+      [ qw( >= > minimum ) ],
+      [ qw( <= < maximum ) ],
+    ) {
+      my ($op, $e_op, $k) = @$pair;
+      if (exists $self->{$k}) {
+        my @new_exclusions = grep { $_ != $self->{ $k } } @exclusions;
+        if (@new_exclusions == @exclusions) {
+          push @parts, "$op $self->{ $k }";
+        } else {
+          push @parts, "$e_op $self->{ $k }";
+          @exclusions = @new_exclusions;
+        }
+      }
+    }
+
+    push @parts, map {; "!= $_" } @exclusions;
+
+    return join q{, }, @parts;
+  }
+
+  sub with_exact_version {
+    my ($self, $version) = @_;
+    $self = $self->_clone;
+
+    Carp::confess("illegal requirements: exact specification outside of range")
+      unless $self->_accepts($version);
+
+    return CPAN::Meta::Requirements::_Range::Exact->_new($version);
+  }
+
+  sub _simplify {
+    my ($self) = @_;
+
+    if (defined $self->{minimum} and defined $self->{maximum}) {
+      if ($self->{minimum} == $self->{maximum}) {
+        Carp::confess("illegal requirements: excluded all values")
+          if grep { $_ == $self->{minimum} } @{ $self->{exclusions} || [] };
+
+        return CPAN::Meta::Requirements::_Range::Exact->_new($self->{minimum})
+      }
+
+      Carp::confess("illegal requirements: minimum exceeds maximum")
+        if $self->{minimum} > $self->{maximum};
+    }
+
+    # eliminate irrelevant exclusions
+    if ($self->{exclusions}) {
+      my %seen;
+      @{ $self->{exclusions} } = grep {
+        (! defined $self->{minimum} or $_ >= $self->{minimum})
+        and
+        (! defined $self->{maximum} or $_ <= $self->{maximum})
+        and
+        ! $seen{$_}++
+      } @{ $self->{exclusions} };
+    }
+
+    return $self;
+  }
+
+  sub with_minimum {
+    my ($self, $minimum) = @_;
+    $self = $self->_clone;
+
+    if (defined (my $old_min = $self->{minimum})) {
+      $self->{minimum} = (sort { $b cmp $a } ($minimum, $old_min))[0];
+    } else {
+      $self->{minimum} = $minimum;
+    }
+
+    return $self->_simplify;
+  }
+
+  sub with_maximum {
+    my ($self, $maximum) = @_;
+    $self = $self->_clone;
+
+    if (defined (my $old_max = $self->{maximum})) {
+      $self->{maximum} = (sort { $a cmp $b } ($maximum, $old_max))[0];
+    } else {
+      $self->{maximum} = $maximum;
+    }
+
+    return $self->_simplify;
+  }
+
+  sub with_exclusion {
+    my ($self, $exclusion) = @_;
+    $self = $self->_clone;
+
+    push @{ $self->{exclusions} ||= [] }, $exclusion;
+
+    return $self->_simplify;
+  }
+
+  sub _accepts {
+    my ($self, $version) = @_;
+
+    return if defined $self->{minimum} and $version < $self->{minimum};
+    return if defined $self->{maximum} and $version > $self->{maximum};
+    return if defined $self->{exclusions}
+          and grep { $version == $_ } @{ $self->{exclusions} };
+
+    return 1;
+  }
+}
+
+1;
+# vim: ts=2 sts=2 sw=2 et:
+
+__END__
+
+=pod
+
+=encoding UTF-8
+
+=head1 NAME
+
+CPAN::Meta::Requirements - a set of version requirements for a CPAN dist
+
+=head1 VERSION
+
+version 2.127
+
+=head1 SYNOPSIS
+
+  use CPAN::Meta::Requirements;
+
+  my $build_requires = CPAN::Meta::Requirements->new;
+
+  $build_requires->add_minimum('Library::Foo' => 1.208);
+
+  $build_requires->add_minimum('Library::Foo' => 2.602);
+
+  $build_requires->add_minimum('Module::Bar'  => 'v1.2.3');
+
+  $METAyml->{build_requires} = $build_requires->as_string_hash;
+
+=head1 DESCRIPTION
+
+A CPAN::Meta::Requirements object models a set of version constraints like
+those specified in the F<META.yml> or F<META.json> files in CPAN distributions,
+and as defined by L<CPAN::Meta::Spec>;
+It can be built up by adding more and more constraints, and it will reduce them
+to the simplest representation.
+
+Logically impossible constraints will be identified immediately by thrown
+exceptions.
+
+=head1 METHODS
+
+=head2 new
+
+  my $req = CPAN::Meta::Requirements->new;
+
+This returns a new CPAN::Meta::Requirements object.  It takes an optional
+hash reference argument.  Currently, only one key is supported:
+
+=over 4
+
+=item *
+
+C<bad_version_hook> -- if provided, when a version cannot be parsed into a version object, this code reference will be called with the invalid version string as an argument.  It must return a valid version object.
+
+=back
+
+All other keys are ignored.
+
+=head2 add_minimum
+
+  $req->add_minimum( $module => $version );
+
+This adds a new minimum version requirement.  If the new requirement is
+redundant to the existing specification, this has no effect.
+
+Minimum requirements are inclusive.  C<$version> is required, along with any
+greater version number.
+
+This method returns the requirements object.
+
+=head2 add_maximum
+
+  $req->add_maximum( $module => $version );
+
+This adds a new maximum version requirement.  If the new requirement is
+redundant to the existing specification, this has no effect.
+
+Maximum requirements are inclusive.  No version strictly greater than the given
+version is allowed.
+
+This method returns the requirements object.
+
+=head2 add_exclusion
+
+  $req->add_exclusion( $module => $version );
+
+This adds a new excluded version.  For example, you might use these three
+method calls:
+
+  $req->add_minimum( $module => '1.00' );
+  $req->add_maximum( $module => '1.82' );
+
+  $req->add_exclusion( $module => '1.75' );
+
+Any version between 1.00 and 1.82 inclusive would be acceptable, except for
+1.75.
+
+This method returns the requirements object.
+
+=head2 exact_version
+
+  $req->exact_version( $module => $version );
+
+This sets the version required for the given module to I<exactly> the given
+version.  No other version would be considered acceptable.
+
+This method returns the requirements object.
+
+=head2 add_requirements
+
+  $req->add_requirements( $another_req_object );
+
+This method adds all the requirements in the given CPAN::Meta::Requirements object
+to the requirements object on which it was called.  If there are any conflicts,
+an exception is thrown.
+
+This method returns the requirements object.
+
+=head2 accepts_module
+
+  my $bool = $req->accepts_module($module => $version);
+
+Given an module and version, this method returns true if the version
+specification for the module accepts the provided version.  In other words,
+given:
+
+  Module => '>= 1.00, < 2.00'
+
+We will accept 1.00 and 1.75 but not 0.50 or 2.00.
+
+For modules that do not appear in the requirements, this method will return
+true.
+
+=head2 clear_requirement
+
+  $req->clear_requirement( $module );
+
+This removes the requirement for a given module from the object.
+
+This method returns the requirements object.
+
+=head2 requirements_for_module
+
+  $req->requirements_for_module( $module );
+
+This returns a string containing the version requirements for a given module in
+the format described in L<CPAN::Meta::Spec> or undef if the given module has no
+requirements. This should only be used for informational purposes such as error
+messages and should not be interpreted or used for comparison (see
+L</accepts_module> instead.)
+
+=head2 required_modules
+
+This method returns a list of all the modules for which requirements have been
+specified.
+
+=head2 clone
+
+  $req->clone;
+
+This method returns a clone of the invocant.  The clone and the original object
+can then be changed independent of one another.
+
+=head2 is_simple
+
+This method returns true if and only if all requirements are inclusive minimums
+-- that is, if their string expression is just the version number.
+
+=head2 is_finalized
+
+This method returns true if the requirements have been finalized by having the
+C<finalize> method called on them.
+
+=head2 finalize
+
+This method marks the requirements finalized.  Subsequent attempts to change
+the requirements will be fatal, I<if> they would result in a change.  If they
+would not alter the requirements, they have no effect.
+
+If a finalized set of requirements is cloned, the cloned requirements are not
+also finalized.
+
+=head2 as_string_hash
+
+This returns a reference to a hash describing the requirements using the
+strings in the L<CPAN::Meta::Spec> specification.
+
+For example after the following program:
+
+  my $req = CPAN::Meta::Requirements->new;
+
+  $req->add_minimum('CPAN::Meta::Requirements' => 0.102);
+
+  $req->add_minimum('Library::Foo' => 1.208);
+
+  $req->add_maximum('Library::Foo' => 2.602);
+
+  $req->add_minimum('Module::Bar'  => 'v1.2.3');
+
+  $req->add_exclusion('Module::Bar'  => 'v1.2.8');
+
+  $req->exact_version('Xyzzy'  => '6.01');
+
+  my $hashref = $req->as_string_hash;
+
+C<$hashref> would contain:
+
+  {
+    'CPAN::Meta::Requirements' => '0.102',
+    'Library::Foo' => '>= 1.208, <= 2.206',
+    'Module::Bar'  => '>= v1.2.3, != v1.2.8',
+    'Xyzzy'        => '== 6.01',
+  }
+
+=head2 add_string_requirement
+
+  $req->add_string_requirement('Library::Foo' => '>= 1.208, <= 2.206');
+
+This method parses the passed in string and adds the appropriate requirement
+for the given module.  It understands version ranges as described in the
+L<CPAN::Meta::Spec/Version Ranges>. For example:
+
+=over 4
+
+=item 1.3
+
+=item >= 1.3
+
+=item <= 1.3
+
+=item == 1.3
+
+=item != 1.3
+
+=item > 1.3
+
+=item < 1.3
+
+=item >= 1.3, != 1.5, <= 2.0
+
+A version number without an operator is equivalent to specifying a minimum
+(C<E<gt>=>).  Extra whitespace is allowed.
+
+=back
+
+=head2 from_string_hash
+
+  my $req = CPAN::Meta::Requirements->from_string_hash( \%hash );
+
+This is an alternate constructor for a CPAN::Meta::Requirements object.  It takes
+a hash of module names and version requirement strings and returns a new
+CPAN::Meta::Requirements object.
+
+=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
+
+=head1 SUPPORT
+
+=head2 Bugs / Feature Requests
+
+Please report any bugs or feature requests through the issue tracker
+at L<https://github.com/dagolden/CPAN-Meta-Requirements/issues>.
+You will be notified automatically of any progress on your issue.
+
+=head2 Source Code
+
+This is open source software.  The code repository is available for
+public review and contribution under the terms of the license.
+
+L<https://github.com/dagolden/CPAN-Meta-Requirements>
+
+  git clone https://github.com/dagolden/CPAN-Meta-Requirements.git
+
+=head1 AUTHORS
+
+=over 4
+
+=item *
+
+David Golden <dagolden@cpan.org>
+
+=item *
+
+Ricardo Signes <rjbs@cpan.org>
+
+=back
+
+=head1 CONTRIBUTORS
+
+=for stopwords Karen Etheridge robario
+
+=over 4
+
+=item *
+
+Karen Etheridge <ether@cpan.org>
+
+=item *
+
+robario <webmaster@robario.com>
+
+=back
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2010 by David Golden and Ricardo Signes.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
@@ -40,6 +40,7 @@
 \.tmp$
 \.#
 \.rej$
+\..*\.sw.?$
 
 # Avoid OS-specific files/dirs
 # Mac OSX metadata
@@ -50,6 +51,9 @@
 # Avoid Devel::Cover and Devel::CoverX::Covered files.
 \bcover_db\b
 \bcovered\b
- 
+
+# Avoid prove files
+\B\.prove$
+
 # Avoid MYMETA files
 ^MYMETA\.
@@ -8,24 +8,21 @@ use File::Find;
 use File::Spec;
 use Carp;
 use strict;
+use warnings;
 
-use vars qw($VERSION @ISA @EXPORT_OK 
-          $Is_MacOS $Is_VMS $Is_VMS_mode $Is_VMS_lc $Is_VMS_nodot
-          $Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-
-$VERSION = '1.60';
-@ISA=('Exporter');
-@EXPORT_OK = qw(mkmanifest
+our $VERSION = '1.65';
+our @ISA = ('Exporter');
+our @EXPORT_OK = qw(mkmanifest
                 manicheck  filecheck  fullcheck  skipcheck
                 manifind   maniread   manicopy   maniadd
                 maniskip
                );
 
-$Is_MacOS = $^O eq 'MacOS';
-$Is_VMS   = $^O eq 'VMS';
-$Is_VMS_mode = 0;
-$Is_VMS_lc = 0;
-$Is_VMS_nodot = 0;  # No dots in dir names or double dots in files
+our $Is_MacOS = $^O eq 'MacOS';
+our $Is_VMS   = $^O eq 'VMS';
+our $Is_VMS_mode = 0;
+our $Is_VMS_lc = 0;
+our $Is_VMS_nodot = 0;  # No dots in dir names or double dots in files
 
 if ($Is_VMS) {
     require VMS::Filespec if $Is_VMS;
@@ -44,7 +41,7 @@ if ($Is_VMS) {
         my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
         my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
         my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
-        $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i; 
+        $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
         $vms_efs = $efs_charset =~ /^[ET1]/i;
         $vms_case = $efs_case =~ /^[ET1]/i;
     }
@@ -53,13 +50,13 @@ if ($Is_VMS) {
     $Is_VMS_nodot = 0 if ($vms_efs);
 }
 
-$Debug   = $ENV{PERL_MM_MANIFEST_DEBUG} || 0;
-$Verbose = defined $ENV{PERL_MM_MANIFEST_VERBOSE} ?
+our $Debug   = $ENV{PERL_MM_MANIFEST_DEBUG} || 0;
+our $Verbose = defined $ENV{PERL_MM_MANIFEST_VERBOSE} ?
                    $ENV{PERL_MM_MANIFEST_VERBOSE} : 1;
-$Quiet = 0;
-$MANIFEST = 'MANIFEST';
+our $Quiet = 0;
+our $MANIFEST = 'MANIFEST';
 
-$DEFAULT_MSKIP = File::Spec->catfile( dirname(__FILE__), "$MANIFEST.SKIP" );
+our $DEFAULT_MSKIP = File::Spec->catfile( dirname(__FILE__), "$MANIFEST.SKIP" );
 
 
 =head1 NAME
@@ -124,6 +121,7 @@ sub mkmanifest {
     $bakbase =~ s/\./_/g if $Is_VMS_nodot; # avoid double dots
     rename $MANIFEST, "$bakbase.bak" unless $manimiss;
     open M, "> $MANIFEST" or die "Could not open $MANIFEST: $!";
+    binmode M, ':raw';
     my $skip = maniskip();
     my $found = manifind();
     my($key,$val,$file,%all);
@@ -155,12 +153,20 @@ sub mkmanifest {
     close M;
 }
 
-# Geez, shouldn't this use File::Spec or File::Basename or something?  
+# Geez, shouldn't this use File::Spec or File::Basename or something?
 # Why so careful about dependencies?
 sub clean_up_filename {
   my $filename = shift;
   $filename =~ s|^\./||;
   $filename =~ s/^:([^:]+)$/$1/ if $Is_MacOS;
+  if ( $Is_VMS ) {
+      $filename =~ s/\.$//;                           # trim trailing dot
+      $filename = VMS::Filespec::unixify($filename);  # unescape spaces, etc.
+      if( $Is_VMS_lc ) {
+          $filename = lc($filename);
+          $filename = uc($filename) if $filename =~ /^MANIFEST(\.SKIP)?$/i;
+      }
+  }
   return $filename;
 }
 
@@ -182,17 +188,12 @@ sub manifind {
 	my $name = clean_up_filename($File::Find::name);
 	warn "Debug: diskfile $name\n" if $Debug;
 	return if -d $_;
-
-        if( $Is_VMS_lc ) {
-            $name =~ s#(.*)\.$#\L$1#;
-            $name = uc($name) if $name =~ /^MANIFEST(\.SKIP)?$/i;
-        }
 	$found->{$name} = "";
     };
 
-    # We have to use "$File::Find::dir/$_" in preprocess, because 
+    # We have to use "$File::Find::dir/$_" in preprocess, because
     # $File::Find::name is unavailable.
-    # Also, it's okay to use / here, because MANIFEST files use Unix-style 
+    # Also, it's okay to use / here, because MANIFEST files use Unix-style
     # paths.
     find({wanted => $wanted},
 	 $Is_MacOS ? ":" : ".");
@@ -377,9 +378,11 @@ sub maniread {
                 my $okfile = "$dir$base";
                 warn "Debug: Illegal name $file changed to $okfile\n" if $Debug;
                 $file = $okfile;
-            } 
-            $file = lc($file)
-                unless $Is_VMS_lc &&($file =~ /^MANIFEST(\.SKIP)?$/);
+            }
+            if( $Is_VMS_lc ) {
+                $file = lc($file);
+                $file = uc($file) if $file =~ /^MANIFEST(\.SKIP)?$/i;
+            }
         }
 
         $read->{$file} = $comment;
@@ -414,8 +417,8 @@ sub maniskip {
       $_ =~ qr{^\s*(?:(?:'([^\\']*(?:\\.[^\\']*)*)')|([^#\s]\S*))?(?:(?:\s*)|(?:\s+(.*?)\s*))$};
       #my $comment = $3;
       my $filename = $2;
-      if ( defined($1) ) { 
-        $filename = $1; 
+      if ( defined($1) ) {
+        $filename = $1;
         $filename =~ s/\\(['\\])/$1/g;
       }
       next if (not defined($filename) or not $filename);
@@ -478,6 +481,7 @@ sub _check_mskip_directives {
         warn "Problem opening $mfile: $!";
         return;
     }
+    binmode M, ':raw';
     print M $_ for (@lines);
     close M;
     return;
@@ -514,13 +518,13 @@ typically returned by the maniread() function.
 
     manicopy( maniread(), $dest_dir );
 
-This function is useful for producing a directory tree identical to the 
-intended distribution tree. 
+This function is useful for producing a directory tree identical to the
+intended distribution tree.
 
 $how can be used to specify a different methods of "copying".  Valid
 values are C<cp>, which actually copies the files, C<ln> which creates
 hard links, and C<best> which mostly links the files but copies any
-symbolic link to make a tree without any symbolic link.  C<cp> is the 
+symbolic link to make a tree without any symbolic link.  C<cp> is the
 default.
 
 =cut
@@ -535,11 +539,11 @@ sub manicopy {
     $target = VMS::Filespec::unixify($target) if $Is_VMS_mode;
     File::Path::mkpath([ $target ],! $Quiet,$Is_VMS ? undef : 0755);
     foreach my $file (keys %$read){
-    	if ($Is_MacOS) {
-	    if ($file =~ m!:!) { 
-	   	my $dir = _maccat($target, $file);
+	if ($Is_MacOS) {
+	    if ($file =~ m!:!) {
+		my $dir = _maccat($target, $file);
 		$dir =~ s/[^:]+$//;
-	    	File::Path::mkpath($dir,1,0755);
+		File::Path::mkpath($dir,1,0755);
 	    }
 	    cp_if_diff($file, _maccat($target, $file), $how);
 	} else {
@@ -689,8 +693,9 @@ sub maniadd {
     my @needed = grep { !exists $manifest->{$_} } keys %$additions;
     return 1 unless @needed;
 
-    open(MANIFEST, ">>$MANIFEST") or 
+    open(MANIFEST, ">>$MANIFEST") or
       die "maniadd() could not open $MANIFEST: $!";
+    binmode MANIFEST, ':raw';
 
     foreach my $file (_sort @needed) {
         my $comment = $additions->{$file} || '';
@@ -732,6 +737,7 @@ sub _fix_manifest {
     if ( $must_rewrite ) {
         1 while unlink $MANIFEST; # avoid multiple versions on VMS
         open MANIFEST, ">", $MANIFEST or die "(must_rewrite=$must_rewrite) Could not open >$MANIFEST: $!";
+	binmode MANIFEST, ':raw';
         for (my $i=0; $i<=$#manifest; $i+=2) {
             print MANIFEST "$manifest[$i]\n";
         }
@@ -1,696 +0,0 @@
-package File::Copy::Recursive;
-
-use strict;
-BEGIN {
-    # Keep older versions of Perl from trying to use lexical warnings
-    $INC{'warnings.pm'} = "fake warnings entry for < 5.6 perl ($])" if $] < 5.006;
-}
-use warnings;
-
-use Carp;
-use File::Copy; 
-use File::Spec; #not really needed because File::Copy already gets it, but for good measure :)
-
-use vars qw( 
-    @ISA      @EXPORT_OK $VERSION  $MaxDepth $KeepMode $CPRFComp $CopyLink 
-    $PFSCheck $RemvBase $NoFtlPth  $ForcePth $CopyLoop $RMTrgFil $RMTrgDir 
-    $CondCopy $BdTrgWrn $SkipFlop  $DirPerms
-);
-
-require Exporter;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(fcopy rcopy dircopy fmove rmove dirmove pathmk pathrm pathempty pathrmdir);
-$VERSION = '0.38';
-
-$MaxDepth = 0;
-$KeepMode = 1;
-$CPRFComp = 0; 
-$CopyLink = eval { local $SIG{'__DIE__'};symlink '',''; 1 } || 0;
-$PFSCheck = 1;
-$RemvBase = 0;
-$NoFtlPth = 0;
-$ForcePth = 0;
-$CopyLoop = 0;
-$RMTrgFil = 0;
-$RMTrgDir = 0;
-$CondCopy = {};
-$BdTrgWrn = 0;
-$SkipFlop = 0;
-$DirPerms = 0777; 
-
-my $samecheck = sub {
-   return 1 if $^O eq 'MSWin32'; # need better way to check for this on winders...
-   return if @_ != 2 || !defined $_[0] || !defined $_[1];
-   return if $_[0] eq $_[1];
-
-   my $one = '';
-   if($PFSCheck) {
-      $one    = join( '-', ( stat $_[0] )[0,1] ) || '';
-      my $two = join( '-', ( stat $_[1] )[0,1] ) || '';
-      if ( $one eq $two && $one ) {
-          carp "$_[0] and $_[1] are identical";
-          return;
-      }
-   }
-
-   if(-d $_[0] && !$CopyLoop) {
-      $one    = join( '-', ( stat $_[0] )[0,1] ) if !$one;
-      my $abs = File::Spec->rel2abs($_[1]);
-      my @pth = File::Spec->splitdir( $abs );
-      while(@pth) {
-         my $cur = File::Spec->catdir(@pth);
-         last if !$cur; # probably not necessary, but nice to have just in case :)
-         my $two = join( '-', ( stat $cur )[0,1] ) || '';
-         if ( $one eq $two && $one ) {
-             # $! = 62; # Too many levels of symbolic links
-             carp "Caught Deep Recursion Condition: $_[0] contains $_[1]";
-             return;
-         }
-      
-         pop @pth;
-      }
-   }
-
-   return 1;
-};
-
-my $glob = sub {
-    my ($do, $src_glob, @args) = @_;
-    
-    local $CPRFComp = 1;
-    
-    my @rt;
-    for my $path ( glob($src_glob) ) {
-        my @call = [$do->($path, @args)] or return;
-        push @rt, \@call;
-    }
-    
-    return @rt;
-};
-
-my $move = sub {
-   my $fl = shift;
-   my @x;
-   if($fl) {
-      @x = fcopy(@_) or return;
-   } else {
-      @x = dircopy(@_) or return;
-   }
-   if(@x) {
-      if($fl) {
-         unlink $_[0] or return;
-      } else {
-         pathrmdir($_[0]) or return;
-      }
-      if($RemvBase) {
-         my ($volm, $path) = File::Spec->splitpath($_[0]);
-         pathrm(File::Spec->catpath($volm,$path,''), $ForcePth, $NoFtlPth) or return;
-      }
-   }
-  return wantarray ? @x : $x[0];
-};
-
-my $ok_todo_asper_condcopy = sub {
-    my $org = shift;
-    my $copy = 1;
-    if(exists $CondCopy->{$org}) {
-        if($CondCopy->{$org}{'md5'}) {
-
-        }
-        if($copy) {
-
-        }
-    }
-    return $copy;
-};
-
-sub fcopy { 
-   $samecheck->(@_) or return;
-   if($RMTrgFil && (-d $_[1] || -e $_[1]) ) {
-      my $trg = $_[1];
-      if( -d $trg ) {
-        my @trgx = File::Spec->splitpath( $_[0] );
-        $trg = File::Spec->catfile( $_[1], $trgx[ $#trgx ] );
-      }
-      $samecheck->($_[0], $trg) or return;
-      if(-e $trg) {
-         if($RMTrgFil == 1) {
-            unlink $trg or carp "\$RMTrgFil failed: $!";
-         } else {
-            unlink $trg or return;
-         }
-      }
-   }
-   my ($volm, $path) = File::Spec->splitpath($_[1]);
-   if($path && !-d $path) {
-      pathmk(File::Spec->catpath($volm,$path,''), $NoFtlPth);
-   }
-   if( -l $_[0] && $CopyLink ) {
-      carp "Copying a symlink ($_[0]) whose target does not exist" 
-          if !-e readlink($_[0]) && $BdTrgWrn;
-      symlink readlink(shift()), shift() or return;
-   } else {  
-      copy(@_) or return;
-
-      my @base_file = File::Spec->splitpath($_[0]);
-      my $mode_trg = -d $_[1] ? File::Spec->catfile($_[1], $base_file[ $#base_file ]) : $_[1];
-
-      chmod scalar((stat($_[0]))[2]), $mode_trg if $KeepMode;
-   }
-   return wantarray ? (1,0,0) : 1; # use 0's incase they do math on them and in case rcopy() is called in list context = no uninit val warnings
-}
-
-sub rcopy { 
-    if (-l $_[0] && $CopyLink) {
-        goto &fcopy;    
-    }
-    
-    goto &dircopy if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
-    goto &fcopy;
-}
-
-sub rcopy_glob {
-    $glob->(\&rcopy, @_);
-}
-
-sub dircopy {
-   if($RMTrgDir && -d $_[1]) {
-      if($RMTrgDir == 1) {
-         pathrmdir($_[1]) or carp "\$RMTrgDir failed: $!";
-      } else {
-         pathrmdir($_[1]) or return;
-      }
-   }
-   my $globstar = 0;
-   my $_zero = $_[0];
-   my $_one = $_[1];
-   if ( substr( $_zero, ( 1 * -1 ), 1 ) eq '*') {
-       $globstar = 1;
-       $_zero = substr( $_zero, 0, ( length( $_zero ) - 1 ) );
-   }
-
-   $samecheck->(  $_zero, $_[1] ) or return;
-   if ( !-d $_zero || ( -e $_[1] && !-d $_[1] ) ) {
-       $! = 20; 
-       return;
-   } 
-
-   if(!-d $_[1]) {
-      pathmk($_[1], $NoFtlPth) or return;
-   } else {
-      if($CPRFComp && !$globstar) {
-         my @parts = File::Spec->splitdir($_zero);
-         while($parts[ $#parts ] eq '') { pop @parts; }
-         $_one = File::Spec->catdir($_[1], $parts[$#parts]);
-      }
-   }
-   my $baseend = $_one;
-   my $level   = 0;
-   my $filen   = 0;
-   my $dirn    = 0;
-
-   my $recurs; #must be my()ed before sub {} since it calls itself
-   $recurs =  sub {
-      my ($str,$end,$buf) = @_;
-      $filen++ if $end eq $baseend; 
-      $dirn++ if $end eq $baseend;
-      
-      $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
-      mkdir($end,$DirPerms) or return if !-d $end;
-      chmod scalar((stat($str))[2]), $end if $KeepMode;
-      if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) {
-         return ($filen,$dirn,$level) if wantarray;
-         return $filen;
-      }
-      $level++;
-
-      
-      my @files;
-      if ( $] < 5.006 ) {
-          opendir(STR_DH, $str) or return;
-          @files = grep( $_ ne '.' && $_ ne '..', readdir(STR_DH));
-          closedir STR_DH;
-      }
-      else {
-          opendir(my $str_dh, $str) or return;
-          @files = grep( $_ ne '.' && $_ ne '..', readdir($str_dh));
-          closedir $str_dh;
-      }
-
-      for my $file (@files) {
-          my ($file_ut) = $file =~ m{ (.*) }xms;
-          my $org = File::Spec->catfile($str, $file_ut);
-          my $new = File::Spec->catfile($end, $file_ut);
-          if( -l $org && $CopyLink ) {
-              carp "Copying a symlink ($org) whose target does not exist" 
-                  if !-e readlink($org) && $BdTrgWrn;
-              symlink readlink($org), $new or return;
-          } 
-          elsif(-d $org) {
-              $recurs->($org,$new,$buf) if defined $buf;
-              $recurs->($org,$new) if !defined $buf;
-              $filen++;
-              $dirn++;
-          } 
-          else {
-              if($ok_todo_asper_condcopy->($org)) {
-                  if($SkipFlop) {
-                      fcopy($org,$new,$buf) or next if defined $buf;
-                      fcopy($org,$new) or next if !defined $buf;                      
-                  }
-                  else {
-                      fcopy($org,$new,$buf) or return if defined $buf;
-                      fcopy($org,$new) or return if !defined $buf;
-                  }
-                  chmod scalar((stat($org))[2]), $new if $KeepMode;
-                  $filen++;
-              }
-          }
-      }
-      1;
-   };
-
-   $recurs->($_zero, $_one, $_[2]) or return;
-   return wantarray ? ($filen,$dirn,$level) : $filen;
-}
-
-sub fmove { $move->(1, @_) } 
-
-sub rmove { 
-    if (-l $_[0] && $CopyLink) {
-        goto &fmove;    
-    }
-    
-    goto &dirmove if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
-    goto &fmove;
-}
-
-sub rmove_glob {
-    $glob->(\&rmove, @_);
-}
-
-sub dirmove { $move->(0, @_) }
-
-sub pathmk {
-   my @parts = File::Spec->splitdir( shift() );
-   my $nofatal = shift;
-   my $pth = $parts[0];
-   my $zer = 0;
-   if(!$pth) {
-      $pth = File::Spec->catdir($parts[0],$parts[1]);
-      $zer = 1;
-   }
-   for($zer..$#parts) {
-      $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
-      mkdir($pth,$DirPerms) or return if !-d $pth && !$nofatal;
-      mkdir($pth,$DirPerms) if !-d $pth && $nofatal;
-      $pth = File::Spec->catdir($pth, $parts[$_ + 1]) unless $_ == $#parts;
-   }
-   1;
-} 
-
-sub pathempty {
-   my $pth = shift; 
-
-   return 2 if !-d $pth;
-
-   my @names;
-   my $pth_dh;
-   if ( $] < 5.006 ) {
-       opendir(PTH_DH, $pth) or return;
-       @names = grep !/^\.+$/, readdir(PTH_DH);
-   }
-   else {
-       opendir($pth_dh, $pth) or return;
-       @names = grep !/^\.+$/, readdir($pth_dh);       
-   }
-   
-   for my $name (@names) {
-      my ($name_ut) = $name =~ m{ (.*) }xms;
-      my $flpth     = File::Spec->catdir($pth, $name_ut);
-
-      if( -l $flpth ) {
-	      unlink $flpth or return; 
-      }
-      elsif(-d $flpth) {
-          pathrmdir($flpth) or return;
-      } 
-      else {
-          unlink $flpth or return;
-      }
-   }
-
-   if ( $] < 5.006 ) {
-       closedir PTH_DH;
-   }
-   else {
-       closedir $pth_dh;
-   }
-   
-   1;
-}
-
-sub pathrm {
-   my $path = shift;
-   return 2 if !-d $path;
-   my @pth = File::Spec->splitdir( $path );
-   my $force = shift;
-
-   while(@pth) { 
-      my $cur = File::Spec->catdir(@pth);
-      last if !$cur; # necessary ??? 
-      if(!shift()) {
-         pathempty($cur) or return if $force;
-         rmdir $cur or return;
-      } 
-      else {
-         pathempty($cur) if $force;
-         rmdir $cur;
-      }
-      pop @pth;
-   }
-   1;
-}
-
-sub pathrmdir {
-    my $dir = shift;
-    if( -e $dir ) {
-        return if !-d $dir;
-    }
-    else {
-        return 2;
-    }
-
-    pathempty($dir) or return;
-    
-    rmdir $dir or return;
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-File::Copy::Recursive - Perl extension for recursively copying files and directories
-
-=head1 SYNOPSIS
-
-  use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
-
-  fcopy($orig,$new[,$buf]) or die $!;
-  rcopy($orig,$new[,$buf]) or die $!;
-  dircopy($orig,$new[,$buf]) or die $!;
-
-  fmove($orig,$new[,$buf]) or die $!;
-  rmove($orig,$new[,$buf]) or die $!;
-  dirmove($orig,$new[,$buf]) or die $!;
-  
-  rcopy_glob("orig/stuff-*", $trg [, $buf]) or die $!;
-  rmove_glob("orig/stuff-*", $trg [,$buf]) or die $!;
-
-=head1 DESCRIPTION
-
-This module copies and moves directories recursively (or single files, well... singley) to an optional depth and attempts to preserve each file or directory's mode.
-
-=head1 EXPORT
-
-None by default. But you can export all the functions as in the example above and the path* functions if you wish.
-
-=head2 fcopy()
-
-This function uses File::Copy's copy() function to copy a file but not a directory. Any directories are recursively created if need be.
-One difference to File::Copy::copy() is that fcopy attempts to preserve the mode (see Preserving Mode below)
-The optional $buf in the synopsis if the same as File::Copy::copy()'s 3rd argument
-returns the same as File::Copy::copy() in scalar context and 1,0,0 in list context to accomidate rcopy()'s list context on regular files. (See below for more info)
-
-=head2 dircopy()
-
-This function recursively traverses the $orig directory's structure and recursively copies it to the $new directory.
-$new is created if necessary (multiple non existant directories is ok (IE foo/bar/baz). The script logically and portably creates all of them if necessary).
-It attempts to preserve the mode (see Preserving Mode below) and 
-by default it copies all the way down into the directory, (see Managing Depth) below.
-If a directory is not specified it croaks just like fcopy croaks if its not a file that is specified.
-
-returns true or false, for true in scalar context it returns the number of files and directories copied,
-In list context it returns the number of files and directories, number of directories only, depth level traversed.
-
-  my $num_of_files_and_dirs = dircopy($orig,$new);
-  my($num_of_files_and_dirs,$num_of_dirs,$depth_traversed) = dircopy($orig,$new);
-  
-Normally it stops and return's if a copy fails, to continue on regardless set $File::Copy::Recursive::SkipFlop to true.
-
-    local $File::Copy::Recursive::SkipFlop = 1;
-
-That way it will copy everythgingit can ina directory and won't stop because of permissions, etc...
-
-=head2 rcopy()
-
-This function will allow you to specify a file *or* directory. It calls fcopy() if its a file and dircopy() if its a directory.
-If you call rcopy() (or fcopy() for that matter) on a file in list context, the values will be 1,0,0 since no directories and no depth are used. 
-This is important becasue if its a directory in list context and there is only the initial directory the return value is 1,1,1.
-
-=head2 rcopy_glob()
-
-This function lets you specify a pattern suitable for perl's glob() as the first argument. Subsequently each path returned by perl's glob() gets rcopy()ied.
-
-It returns and array whose items are array refs that contain the return value of each rcopy() call.
-
-It forces behavior as if $File::Copy::Recursive::CPRFComp is true.
-
-=head2 fmove()
-
-Copies the file then removes the original. You can manage the path the original file is in according to $RemvBase.
-
-=head2 dirmove()
-
-Uses dircopy() to copy the directory then removes the original. You can manage the path the original directory is in according to $RemvBase.
-
-=head2 rmove()
-
-Like rcopy() but calls fmove() or dirmove() instead.
-
-=head2 rmove_glob()
-
-Like rcopy_glob() but calls rmove() instead of rcopy()
-
-=head3 $RemvBase
-
-Default is false. When set to true the *move() functions will not only attempt to remove the original file or directory but will remove the given path it is in.
-
-So if you:
-
-   rmove('foo/bar/baz', '/etc/');
-   # "baz" is removed from foo/bar after it is successfully copied to /etc/
-   
-   local $File::Copy::Recursive::Remvbase = 1;
-   rmove('foo/bar/baz','/etc/');
-   # if baz is successfully copied to /etc/ :
-   # first "baz" is removed from foo/bar
-   # then "foo/bar is removed via pathrm()
-
-=head4 $ForcePth
-
-Default is false. When set to true it calls pathempty() before any directories are removed to empty the directory so it can be rmdir()'ed when $RemvBase is in effect.
-
-=head2 Creating and Removing Paths
-
-=head3 $NoFtlPth
-
-Default is false. If set to true  rmdir(), mkdir(), and pathempty() calls in pathrm() and pathmk() do not return() on failure.
-
-If its set to true they just silently go about their business regardless. This isn't a good idea but its there if you want it.
-
-=head3 $DirPerms
-
-Mode to pass to any mkdir() calls. Defaults to 0777 as per umask()'s POD. Explicitly having this allows older perls to be able to use FCR and might add a bit of flexibility for you.
-
-Any value you set it to should be suitable for oct()
-
-=head3 Path functions
-
-These functions exist soley because they were necessary for the move and copy functions to have the features they do and not because they are of themselves the purpose of this module. That being said, here is how they work so you can understand how the copy and move funtions work and use them by themselves if you wish.
-
-=head4 pathrm()
-
-Removes a given path recursively. It removes the *entire* path so be carefull!!!
-
-Returns 2 if the given path is not a directory.
-
-  File::Copy::Recursive::pathrm('foo/bar/baz') or die $!;
-  # foo no longer exists
-
-Same as:
-
-  rmdir 'foo/bar/baz' or die $!;
-  rmdir 'foo/bar' or die $!;
-  rmdir 'foo' or die $!;
-
-An optional second argument makes it call pathempty() before any rmdir()'s when set to true.
-
-  File::Copy::Recursive::pathrm('foo/bar/baz', 1) or die $!;
-  # foo no longer exists
-
-Same as:PFSCheck
-
-  File::Copy::Recursive::pathempty('foo/bar/baz') or die $!;
-  rmdir 'foo/bar/baz' or die $!;
-  File::Copy::Recursive::pathempty('foo/bar/') or die $!;
-  rmdir 'foo/bar' or die $!;
-  File::Copy::Recursive::pathempty('foo/') or die $!;
-  rmdir 'foo' or die $!;
-
-An optional third argument acts like $File::Copy::Recursive::NoFtlPth, again probably not a good idea.
-
-=head4 pathempty()
-
-Recursively removes the given directory's contents so it is empty. returns 2 if argument is not a directory, 1 on successfully emptying the directory.
-
-   File::Copy::Recursive::pathempty($pth) or die $!;
-   # $pth is now an empty directory
-
-=head4 pathmk()
-
-Creates a given path recursively. Creates foo/bar/baz even if foo does not exist.
-
-   File::Copy::Recursive::pathmk('foo/bar/baz') or die $!;
-
-An optional second argument if true acts just like $File::Copy::Recursive::NoFtlPth, which means you'd never get your die() if something went wrong. Again, probably a *bad* idea.
-
-=head4 pathrmdir()
-
-Same as rmdir() but it calls pathempty() first to recursively empty it first since rmdir can not remove a directory with contents.
-Just removes the top directory the path given instead of the entire path like pathrm(). Return 2 if given argument does not exist (IE its already gone). Return false if it exists but is not a directory.
-
-=head2 Preserving Mode
-
-By default a quiet attempt is made to change the new file or directory to the mode of the old one.
-To turn this behavior off set
-  $File::Copy::Recursive::KeepMode
-to false;
-
-=head2 Managing Depth
-
-You can set the maximum depth a directory structure is recursed by setting:
-  $File::Copy::Recursive::MaxDepth 
-to a whole number greater than 0.
-
-=head2 SymLinks
-
-If your system supports symlinks then symlinks will be copied as symlinks instead of as the target file.
-Perl's symlink() is used instead of File::Copy's copy()
-You can customize this behavior by setting $File::Copy::Recursive::CopyLink to a true or false value.
-It is already set to true or false dending on your system's support of symlinks so you can check it with an if statement to see how it will behave:
-
-    if($File::Copy::Recursive::CopyLink) {
-        print "Symlinks will be preserved\n";
-    } else {
-        print "Symlinks will not be preserved because your system does not support it\n";
-    }
-
-If symlinks are being copied you can set $File::Copy::Recursive::BdTrgWrn to true to make it carp when it copies a link whose target does not exist. Its false by default.
-
-    local $File::Copy::Recursive::BdTrgWrn  = 1;
-
-=head2 Removing existing target file or directory before copying.
-
-This can be done by setting $File::Copy::Recursive::RMTrgFil or $File::Copy::Recursive::RMTrgDir for file or directory behavior respectively.
-
-0 = off (This is the default)
-
-1 = carp() $! if removal fails
-
-2 = return if removal fails
-
-    local $File::Copy::Recursive::RMTrgFil = 1;
-    fcopy($orig, $target) or die $!;
-    # if it fails it does warn() and keeps going
-
-    local $File::Copy::Recursive::RMTrgDir = 2;
-    dircopy($orig, $target) or die $!;
-    # if it fails it does your "or die"
-
-This should be unnecessary most of the time but its there if you need it :)
-
-=head2 Turning off stat() check
-
-By default the files or directories are checked to see if they are the same (IE linked, or two paths (absolute/relative or different relative paths) to the same file) by comparing the file's stat() info. 
-It's a very efficient check that croaks if they are and shouldn't be turned off but if you must for some weird reason just set $File::Copy::Recursive::PFSCheck to a false value. ("PFS" stands for "Physical File System")
-
-=head2 Emulating cp -rf dir1/ dir2/
-
-By default dircopy($dir1,$dir2) will put $dir1's contents right into $dir2 whether $dir2 exists or not.
-
-You can make dircopy() emulate cp -rf by setting $File::Copy::Recursive::CPRFComp to true.
-
-NOTE: This only emulates -f in the sense that it does not prompt. It does not remove the target file or directory if it exists.
-If you need to do that then use the variables $RMTrgFil and $RMTrgDir described in "Removing existing target file or directory before copying" above.
-
-That means that if $dir2 exists it puts the contents into $dir2/$dir1 instead of $dir2 just like cp -rf.
-If $dir2 does not exist then the contents go into $dir2 like normal (also like cp -rf)
-
-So assuming 'foo/file':
-
-    dircopy('foo', 'bar') or die $!;
-    # if bar does not exist the result is bar/file
-    # if bar does exist the result is bar/file
-
-    $File::Copy::Recursive::CPRFComp = 1;
-    dircopy('foo', 'bar') or die $!;
-    # if bar does not exist the result is bar/file
-    # if bar does exist the result is bar/foo/file
-
-You can also specify a star for cp -rf glob type behavior:
-
-    dircopy('foo/*', 'bar') or die $!;
-    # if bar does not exist the result is bar/file
-    # if bar does exist the result is bar/file
-
-    $File::Copy::Recursive::CPRFComp = 1;
-    dircopy('foo/*', 'bar') or die $!;
-    # if bar does not exist the result is bar/file
-    # if bar does exist the result is bar/file
-
-NOTE: The '*' is only like cp -rf foo/* and *DOES NOT EXPAND PARTIAL DIRECTORY NAMES LIKE YOUR SHELL DOES* (IE not like cp -rf fo* to copy foo/*)
-
-=head2 Allowing Copy Loops
-
-If you want to allow:
-
-  cp -rf . foo/
-
-type behavior set $File::Copy::Recursive::CopyLoop to true.
-
-This is false by default so that a check is done to see if the source directory will contain the target directory and croaks to avoid this problem.
-
-If you ever find a situation where $CopyLoop = 1 is desirable let me know (IE its a bad bad idea but is there if you want it)
-
-(Note: On Windows this was necessary since it uses stat() to detemine samedness and stat() is essencially useless for this on Windows. 
-The test is now simply skipped on Windows but I'd rather have an actual reliable check if anyone in Microsoft land would care to share)
-
-=head1 SEE ALSO
-
-L<File::Copy> L<File::Spec>
-
-=head1 TO DO
-
-I am currently working on and reviewing some other modules to use in the new interface so we can lose the horrid globals as well as some other undesirable traits and also more easily make available some long standing requests.
-
-Tests will be easier to do with the new interface and hence the testing focus will shift to the new interface and aim to be comprehensive.
-
-The old interface will work, it just won't be brought in until it is used, so it will add no overhead for users of the new interface.
-
-I'll add this after the latest verision has been out for a while with no new features or issues found :)
-
-=head1 AUTHOR
-
-Daniel Muey, L<http://drmuey.com/cpan_contact.pl>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2004 by Daniel Muey
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself. 
-
-=cut
@@ -1,698 +0,0 @@
-=head1 NAME
-
-version::Internals - Perl extension for Version Objects
-
-=head1 DESCRIPTION
-
-Overloaded version objects for all modern versions of Perl.  This documents
-the internal data representation and underlying code for version.pm.  See
-L<version.pod> for daily usage.  This document is only useful for users
-interested in the gory details.
-
-=head1 WHAT IS A VERSION?
-
-For the purposes of this module, a version "number" is a sequence of
-positive integer values separated by one or more decimal points and
-optionally a single underscore.  This corresponds to what Perl itself
-uses for a version, as well as extending the "version as number" that
-is discussed in the various editions of the Camel book.
-
-There are actually two distinct kinds of version objects:
-
-=over 4
-
-=item Decimal Versions
-
-Any version which "looks like a number", see L<Decimal Versions>.  This
-also includes versions with a single decimal point and a single embedded
-underscore, see L<Alpha Versions>, even though these must be quoted
-to preserve the underscore formatting.
-
-=item Dotted-Decimal Versions
-
-Also referred to as "Dotted-Integer", these contains more than one decimal
-point and may have an optional embedded underscore, see L<Dotted-Decimal
-Versions>.  This is what is commonly used in most open source software as
-the "external" version (the one used as part of the tag or tarfile name).
-A leading 'v' character is now required and will warn if it missing.
-
-=back
-
-Both of these methods will produce similar version objects, in that
-the default stringification will yield the version L<Normal Form> only
-if required:
-
-  $v  = version->new(1.002);     # 1.002, but compares like 1.2.0
-  $v  = version->new(1.002003);  # 1.002003
-  $v2 = version->new("v1.2.3");  # v1.2.3
-
-In specific, version numbers initialized as L<Decimal Versions> will
-stringify as they were originally created (i.e. the same string that was
-passed to C<new()>.  Version numbers initialized as L<Dotted-Decimal Versions>
-will be stringified as L<Normal Form>.
-
-=head2 Decimal Versions
-
-These correspond to historical versions of Perl itself prior to 5.6.0,
-as well as all other modules which follow the Camel rules for the
-$VERSION scalar.  A Decimal version is initialized with what looks like
-a floating point number.  Leading zeros B<are> significant and trailing
-zeros are implied so that a minimum of three places is maintained
-between subversions.  What this means is that any subversion (digits
-to the right of the decimal place) that contains less than three digits
-will have trailing zeros added to make up the difference, but only for
-purposes of comparison with other version objects.  For example:
-
-                                   # Prints     Equivalent to
-  $v = version->new(      1.2);    # 1.2        v1.200.0
-  $v = version->new(     1.02);    # 1.02       v1.20.0
-  $v = version->new(    1.002);    # 1.002      v1.2.0
-  $v = version->new(   1.0023);    # 1.0023     v1.2.300
-  $v = version->new(  1.00203);    # 1.00203    v1.2.30
-  $v = version->new( 1.002003);    # 1.002003   v1.2.3
-
-All of the preceding examples are true whether or not the input value is
-quoted.  The important feature is that the input value contains only a
-single decimal.  See also L<Alpha Versions>.
-
-IMPORTANT NOTE: As shown above, if your Decimal version contains more
-than 3 significant digits after the decimal place, it will be split on
-each multiple of 3, so 1.0003 is equivalent to v1.0.300, due to the need
-to remain compatible with Perl's own 5.005_03 == 5.5.30 interpretation.
-Any trailing zeros are ignored for mathematical comparison purposes.
-
-=head2 Dotted-Decimal Versions
-
-These are the newest form of versions, and correspond to Perl's own
-version style beginning with 5.6.0.  Starting with Perl 5.10.0,
-and most likely Perl 6, this is likely to be the preferred form.  This
-method normally requires that the input parameter be quoted, although
-Perl's after 5.8.1 can use v-strings as a special form of quoting, but
-this is highly discouraged.
-
-Unlike L<Decimal Versions>, Dotted-Decimal Versions have more than
-a single decimal point, e.g.:
-
-                                   # Prints
-  $v = version->new( "v1.200");    # v1.200.0
-  $v = version->new("v1.20.0");    # v1.20.0
-  $v = qv("v1.2.3");               # v1.2.3
-  $v = qv("1.2.3");                # v1.2.3
-  $v = qv("1.20");                 # v1.20.0
-
-In general, Dotted-Decimal Versions permit the greatest amount of freedom
-to specify a version, whereas Decimal Versions enforce a certain
-uniformity.  
-
-Just like L<Decimal Versions>, Dotted-Decimal Versions can be used as
-L<Alpha Versions>.
-
-=head2 Alpha Versions
-
-For module authors using CPAN, the convention has been to note unstable
-releases with an underscore in the version string. (See L<CPAN>.)  version.pm
-follows this convention and alpha releases will test as being newer than the
-more recent stable release, and less than the next stable release.  Only the
-last element may be separated by an underscore:
-
-  # Declaring
-  use version 0.77; our $VERSION = version->declare("v1.2_3");
-
-  # Parsing
-  $v1 = version->parse("v1.2_3");
-  $v1 = version->parse("1.002_003");
-
-Note that you B<must> quote the version when writing an alpha Decimal version.
-The stringified form of Decimal versions will always be the same string that
-was used to initialize the version object.
-
-=head2 Regular Expressions for Version Parsing
-
-A formalized definition of the legal forms for version strings is
-included in the main F<version.pm> file.  Primitives are included for
-common elements, although they are scoped to the file so they are useful
-for reference purposes only.  There are two publicly accessible scalars
-that can be used in other code (not exported):
-
-=over 4
-
-=item C<$version::LAX>
-
-This regexp covers all of the legal forms allowed under the current
-version string parser.  This is not to say that all of these forms
-are recommended, and some of them can only be used when quoted.
-
-For dotted decimals:
-
-    v1.2
-    1.2345.6
-    v1.23_4
-
-The leading 'v' is optional if two or more decimals appear.  If only
-a single decimal is included, then the leading 'v' is required to
-trigger the dotted-decimal parsing.  A leading zero is permitted,
-though not recommended except when quoted, because of the risk that
-Perl will treat the number as octal.  A trailing underscore plus one
-or more digits denotes an alpha or development release (and must be
-quoted to be parsed properly).
-
-For decimal versions:
-
-    1
-    1.2345
-    1.2345_01
-
-an integer portion, an optional decimal point, and optionally one or
-more digits to the right of the decimal are all required.  A trailing
-underscore is permitted and a leading zero is permitted.  Just like
-the lax dotted-decimal version, quoting the values is required for
-alpha/development forms to be parsed correctly.
-
-=item C<$version::STRICT>
-
-This regexp covers a much more limited set of formats and constitutes
-the best practices for initializing version objects.  Whether you choose
-to employ decimal or dotted-decimal for is a personal preference however.
-
-=over 4
-
-=item v1.234.5
-
-For dotted-decimal versions, a leading 'v' is required, with three or
-more sub-versions of no more than three digits.  A leading 0 (zero)
-before the first sub-version (in the above example, '1') is also
-prohibited.
-
-=item 2.3456
-
-For decimal versions, an integer portion (no leading 0), a decimal point,
-and one or more digits to the right of the decimal are all required.
-
-=back
-
-=back
-
-Both of the provided scalars are already compiled as regular expressions
-and do not contain either anchors or implicit groupings, so they can be
-included in your own regular expressions freely.  For example, consider
-the following code:
-
-	($pkg, $ver) =~ /
-		^[ \t]*
-		use [ \t]+($PKGNAME)
-		(?:[ \t]+($version::STRICT))?
-		[ \t]*;
-	/x;
-
-This would match a line of the form:
-
-	use Foo::Bar::Baz v1.2.3;	# legal only in Perl 5.8.1+
-
-where C<$PKGNAME> is another regular expression that defines the legal
-forms for package names.
-
-=head1 IMPLEMENTATION DETAILS
-
-=head2 Equivalence between Decimal and Dotted-Decimal Versions
-
-When Perl 5.6.0 was released, the decision was made to provide a
-transformation between the old-style decimal versions and new-style
-dotted-decimal versions:
-
-  5.6.0    == 5.006000
-  5.005_04 == 5.5.40
-
-The floating point number is taken and split first on the single decimal
-place, then each group of three digits to the right of the decimal makes up
-the next digit, and so on until the number of significant digits is exhausted,
-B<plus> enough trailing zeros to reach the next multiple of three.
-
-This was the method that version.pm adopted as well.  Some examples may be
-helpful:
-
-                            equivalent
-  decimal    zero-padded    dotted-decimal
-  -------    -----------    --------------
-  1.2        1.200          v1.200.0
-  1.02       1.020          v1.20.0
-  1.002      1.002          v1.2.0
-  1.0023     1.002300       v1.2.300
-  1.00203    1.002030       v1.2.30
-  1.002003   1.002003       v1.2.3
-
-=head2 Quoting Rules
-
-Because of the nature of the Perl parsing and tokenizing routines,
-certain initialization values B<must> be quoted in order to correctly
-parse as the intended version, especially when using the L<declare> or
-L<qv> methods.  While you do not have to quote decimal numbers when
-creating version objects, it is always safe to quote B<all> initial values
-when using version.pm methods, as this will ensure that what you type is
-what is used.
-
-Additionally, if you quote your initializer, then the quoted value that goes
-B<in> will be be exactly what comes B<out> when your $VERSION is printed
-(stringified).  If you do not quote your value, Perl's normal numeric handling
-comes into play and you may not get back what you were expecting.
-
-If you use a mathematic formula that resolves to a floating point number,
-you are dependent on Perl's conversion routines to yield the version you
-expect.  You are pretty safe by dividing by a power of 10, for example,
-but other operations are not likely to be what you intend.  For example:
-
-  $VERSION = version->new((qw$Revision: 1.4)[1]/10);
-  print $VERSION;          # yields 0.14
-  $V2 = version->new(100/9); # Integer overflow in decimal number
-  print $V2;               # yields something like 11.111.111.100
-
-Perl 5.8.1 and beyond are able to automatically quote v-strings but
-that is not possible in earlier versions of Perl.  In other words:
-
-  $version = version->new("v2.5.4");  # legal in all versions of Perl
-  $newvers = version->new(v2.5.4);    # legal only in Perl >= 5.8.1
-
-=head2 What about v-strings?
-
-There are two ways to enter v-strings: a bare number with two or more
-decimal points, or a bare number with one or more decimal points and a
-leading 'v' character (also bare).  For example:
-
-  $vs1 = 1.2.3; # encoded as \1\2\3
-  $vs2 = v1.2;  # encoded as \1\2
-
-However, the use of bare v-strings to initialize version objects is
-B<strongly> discouraged in all circumstances.  Also, bare
-v-strings are not completely supported in any version of Perl prior to
-5.8.1.
-
-If you insist on using bare v-strings with Perl > 5.6.0, be aware of the
-following limitations:
-
-1) For Perl releases 5.6.0 through 5.8.0, the v-string code merely guesses,
-based on some characteristics of v-strings.  You B<must> use a three part
-version, e.g. 1.2.3 or v1.2.3 in order for this heuristic to be successful.
-
-2) For Perl releases 5.8.1 and later, v-strings have changed in the Perl
-core to be magical, which means that the version.pm code can automatically
-determine whether the v-string encoding was used.
-
-3) In all cases, a version created using v-strings will have a stringified
-form that has a leading 'v' character, for the simple reason that sometimes
-it is impossible to tell whether one was present initially.
-
-=head2 Version Object Internals
-
-version.pm provides an overloaded version object that is designed to both
-encapsulate the author's intended $VERSION assignment as well as make it
-completely natural to use those objects as if they were numbers (e.g. for
-comparisons).  To do this, a version object contains both the original
-representation as typed by the author, as well as a parsed representation
-to ease comparisons.  Version objects employ L<overload> methods to
-simplify code that needs to compare, print, etc the objects.
-
-The internal structure of version objects is a blessed hash with several
-components:
-
-    bless( {
-      'original' => 'v1.2.3_4',
-      'alpha' => 1,
-      'qv' => 1,
-      'version' => [
-	1,
-	2,
-	3,
-	4
-      ]
-    }, 'version' );
-
-=over 4
-
-=item original
-
-A faithful representation of the value used to initialize this version
-object.  The only time this will not be precisely the same characters
-that exist in the source file is if a short dotted-decimal version like
-v1.2 was used (in which case it will contain 'v1.2').  This form is
-B<STRONGLY> discouraged, in that it will confuse you and your users.
-
-=item qv
-
-A boolean that denotes whether this is a decimal or dotted-decimal version.
-See L<is_qv>.
-
-=item alpha
-
-A boolean that denotes whether this is an alpha version.  NOTE: that the
-underscore can can only appear in the last position.  See L<is_alpha>.
-
-=item version
-
-An array of non-negative integers that is used for comparison purposes with
-other version objects.
-
-=back
-
-=head2 Replacement UNIVERSAL::VERSION
-
-In addition to the version objects, this modules also replaces the core
-UNIVERSAL::VERSION function with one that uses version objects for its
-comparisons.  The return from this operator is always the stringified form
-as a simple scalar (i.e. not an object), but the warning message generated
-includes either the stringified form or the normal form, depending on how
-it was called.
-
-For example:
-
-  package Foo;
-  $VERSION = 1.2;
-
-  package Bar;
-  $VERSION = "v1.3.5"; # works with all Perl's (since it is quoted)
-
-  package main;
-  use version;
-
-  print $Foo::VERSION; # prints 1.2
-
-  print $Bar::VERSION; # prints 1.003005
-
-  eval "use foo 10";
-  print $@; # prints "foo version 10 required..."
-  eval "use foo 1.3.5; # work in Perl 5.6.1 or better
-  print $@; # prints "foo version 1.3.5 required..."
-
-  eval "use bar 1.3.6";
-  print $@; # prints "bar version 1.3.6 required..."
-  eval "use bar 1.004"; # note Decimal version
-  print $@; # prints "bar version 1.004 required..."
-
-
-IMPORTANT NOTE: This may mean that code which searches for a specific
-string (to determine whether a given module is available) may need to be
-changed.  It is always better to use the built-in comparison implicit in
-C<use> or C<require>, rather than manually poking at C<< class->VERSION >>
-and then doing a comparison yourself.
-
-The replacement UNIVERSAL::VERSION, when used as a function, like this:
-
-  print $module->VERSION;
-
-will also exclusively return the stringified form.  See L<Stringification>
-for more details.
-
-=head1 USAGE DETAILS
-
-=head2 Using modules that use version.pm
-
-As much as possible, the version.pm module remains compatible with all
-current code.  However, if your module is using a module that has defined
-C<$VERSION> using the version class, there are a couple of things to be
-aware of.  For purposes of discussion, we will assume that we have the
-following module installed:
-
-  package Example;
-  use version;  $VERSION = qv('1.2.2');
-  ...module code here...
-  1;
-
-=over 4
-
-=item Decimal versions always work
-
-Code of the form:
-
-  use Example 1.002003;
-
-will always work correctly.  The C<use> will perform an automatic
-C<$VERSION> comparison using the floating point number given as the first
-term after the module name (e.g. above 1.002.003).  In this case, the
-installed module is too old for the requested line, so you would see an
-error like:
-
-  Example version 1.002003 (v1.2.3) required--this is only version 1.002002 (v1.2.2)...
-
-=item Dotted-Decimal version work sometimes
-
-With Perl >= 5.6.2, you can also use a line like this:
-
-  use Example 1.2.3;
-
-and it will again work (i.e. give the error message as above), even with
-releases of Perl which do not normally support v-strings (see L<version/What about v-strings> below).  This has to do with that fact that C<use> only checks
-to see if the second term I<looks like a number> and passes that to the
-replacement L<UNIVERSAL::VERSION>.  This is not true in Perl 5.005_04,
-however, so you are B<strongly encouraged> to always use a Decimal version
-in your code, even for those versions of Perl which support the Dotted-Decimal
-version.
-
-=back
-
-=head2 Object Methods
-
-=over 4
-
-=item new()
-
-Like many OO interfaces, the new() method is used to initialize version
-objects.  If two arguments are passed to C<new()>, the B<second> one will be
-used as if it were prefixed with "v".  This is to support historical use of the
-C<qw> operator with the CVS variable $Revision, which is automatically
-incremented by CVS every time the file is committed to the repository.
-
-In order to facilitate this feature, the following
-code can be employed:
-
-  $VERSION = version->new(qw$Revision: 2.7 $);
-
-and the version object will be created as if the following code
-were used:
-
-  $VERSION = version->new("v2.7");
-
-In other words, the version will be automatically parsed out of the
-string, and it will be quoted to preserve the meaning CVS normally
-carries for versions.  The CVS $Revision$ increments differently from
-Decimal versions (i.e. 1.10 follows 1.9), so it must be handled as if
-it were a Dotted-Decimal Version.
-
-A new version object can be created as a copy of an existing version
-object, either as a class method:
-
-  $v1 = version->new(12.3);
-  $v2 = version->new($v1);
-
-or as an object method:
-
-  $v1 = version->new(12.3);
-  $v2 = $v1->new(12.3);
-
-and in each case, $v1 and $v2 will be identical.  NOTE: if you create
-a new object using an existing object like this:
-
-  $v2 = $v1->new();
-
-the new object B<will not> be a clone of the existing object.  In the
-example case, $v2 will be an empty object of the same type as $v1.
-
-=back
-
-=over 4
-
-=item qv()
-
-An alternate way to create a new version object is through the exported
-qv() sub.  This is not strictly like other q? operators (like qq, qw),
-in that the only delimiters supported are parentheses (or spaces).  It is
-the best way to initialize a short version without triggering the floating
-point interpretation.  For example:
-
-  $v1 = qv(1.2);         # v1.2.0
-  $v2 = qv("1.2");       # also v1.2.0
-
-As you can see, either a bare number or a quoted string can usually
-be used interchangably, except in the case of a trailing zero, which
-must be quoted to be converted properly.  For this reason, it is strongly
-recommended that all initializers to qv() be quoted strings instead of
-bare numbers.
-
-To prevent the C<qv()> function from being exported to the caller's namespace,
-either use version with a null parameter:
-
-  use version ();
-
-or just require version, like this:
-
-  require version;
-
-Both methods will prevent the import() method from firing and exporting the
-C<qv()> sub.
-
-=back
-
-For the subsequent examples, the following three objects will be used:
-
-  $ver   = version->new("1.2.3.4"); # see "Quoting Rules"
-  $alpha = version->new("1.2.3_4"); # see "Alpha Versions"
-  $nver  = version->new(1.002);     # see "Decimal Versions"
-
-=over 4
-
-=item Normal Form
-
-For any version object which is initialized with multiple decimal
-places (either quoted or if possible v-string), or initialized using
-the L<qv>() operator, the stringified representation is returned in
-a normalized or reduced form (no extraneous zeros), and with a leading 'v':
-
-  print $ver->normal;         # prints as v1.2.3.4
-  print $ver->stringify;      # ditto
-  print $ver;                 # ditto
-  print $nver->normal;        # prints as v1.2.0
-  print $nver->stringify;     # prints as 1.002, see "Stringification"
-
-In order to preserve the meaning of the processed version, the
-normalized representation will always contain at least three sub terms.
-In other words, the following is guaranteed to always be true:
-
-  my $newver = version->new($ver->stringify);
-  if ($newver eq $ver ) # always true
-    {...}
-
-=back
-
-=over 4
-
-=item Numification
-
-Although all mathematical operations on version objects are forbidden
-by default, it is possible to retrieve a number which corresponds
-to the version object through the use of the $obj->numify
-method.  For formatting purposes, when displaying a number which
-corresponds a version object, all sub versions are assumed to have
-three decimal places.  So for example:
-
-  print $ver->numify;         # prints 1.002003004
-  print $nver->numify;        # prints 1.002
-
-Unlike the stringification operator, there is never any need to append
-trailing zeros to preserve the correct version value.
-
-=back
-
-=over 4
-
-=item Stringification
-
-The default stringification for version objects returns exactly the same
-string as was used to create it, whether you used C<new()> or C<qv()>,
-with one exception.  The sole exception is if the object was created using
-C<qv()> and the initializer did not have two decimal places or a leading
-'v' (both optional), then the stringified form will have a leading 'v'
-prepended, in order to support round-trip processing.
-
-For example:
-
-  Initialized as          Stringifies to
-  ==============          ==============
-  version->new("1.2")       1.2
-  version->new("v1.2")     v1.2
-  qv("1.2.3")               1.2.3
-  qv("v1.3.5")             v1.3.5
-  qv("1.2")                v1.2   ### exceptional case
-
-See also L<UNIVERSAL::VERSION>, as this also returns the stringified form
-when used as a class method.
-
-IMPORTANT NOTE: There is one exceptional cases shown in the above table
-where the "initializer" is not stringwise equivalent to the stringified
-representation.  If you use the C<qv>() operator on a version without a
-leading 'v' B<and> with only a single decimal place, the stringified output
-will have a leading 'v', to preserve the sense.  See the L<qv>() operator
-for more details.
-
-IMPORTANT NOTE 2: Attempting to bypass the normal stringification rules by
-manually applying L<numify>() and L<normal>() will sometimes yield
-surprising results:
-
-  print version->new(version->new("v1.0")->numify)->normal; # v1.0.0
-
-The reason for this is that the L<numify>() operator will turn "v1.0"
-into the equivalent string "1.000000".  Forcing the outer version object
-to L<normal>() form will display the mathematically equivalent "v1.0.0".
-
-As the example in L<new>() shows, you can always create a copy of an
-existing version object with the same value by the very compact:
-
-  $v2 = $v1->new($v1);
-
-and be assured that both C<$v1> and C<$v2> will be completely equivalent,
-down to the same internal representation as well as stringification.
-
-=back
-
-=over 4
-
-=item Comparison operators
-
-Both C<cmp> and C<E<lt>=E<gt>> operators perform the same comparison between
-terms (upgrading to a version object automatically).  Perl automatically
-generates all of the other comparison operators based on those two.
-In addition to the obvious equalities listed below, appending a single
-trailing 0 term does not change the value of a version for comparison
-purposes.  In other words "v1.2" and "1.2.0" will compare as identical.
-
-For example, the following relations hold:
-
-  As Number        As String           Truth Value
-  -------------    ----------------    -----------
-  $ver >  1.0      $ver gt "1.0"       true
-  $ver <  2.5      $ver lt             true
-  $ver != 1.3      $ver ne "1.3"       true
-  $ver == 1.2      $ver eq "1.2"       false
-  $ver == 1.2.3.4  $ver eq "1.2.3.4"   see discussion below
-
-It is probably best to chose either the Decimal notation or the string
-notation and stick with it, to reduce confusion.  Perl6 version objects
-B<may> only support Decimal comparisons.  See also L<Quoting Rules>.
-
-WARNING: Comparing version with unequal numbers of decimal points (whether
-explicitly or implicitly initialized), may yield unexpected results at
-first glance.  For example, the following inequalities hold:
-
-  version->new(0.96)     > version->new(0.95); # 0.960.0 > 0.950.0
-  version->new("0.96.1") < version->new(0.95); # 0.096.1 < 0.950.0
-
-For this reason, it is best to use either exclusively L<Decimal Versions> or
-L<Dotted-Decimal Versions> with multiple decimal points.
-
-=back
-
-=over 4
-
-=item Logical Operators
-
-If you need to test whether a version object
-has been initialized, you can simply test it directly:
-
-  $vobj = version->new($something);
-  if ( $vobj )   # true only if $something was non-blank
-
-You can also test whether a version object is an alpha version, for
-example to prevent the use of some feature not present in the main
-release:
-
-  $vobj = version->new("1.2_3"); # MUST QUOTE
-  ...later...
-  if ( $vobj->is_alpha )       # True
-
-=back
-
-=head1 AUTHOR
-
-John Peacock E<lt>jpeacock@cpan.orgE<gt>
-
-=head1 SEE ALSO
-
-L<perl>.
-
-=cut
@@ -1,931 +0,0 @@
-package charstar;
-# a little helper class to emulate C char* semantics in Perl
-# so that prescan_version can use the same code as in C
-
-use overload (
-    '""'	=> \&thischar,
-    '0+'	=> \&thischar,
-    '++'	=> \&increment,
-    '--'	=> \&decrement,
-    '+'		=> \&plus,
-    '-'		=> \&minus,
-    '*'		=> \&multiply,
-    'cmp'	=> \&cmp,
-    '<=>'	=> \&spaceship,
-    'bool'	=> \&thischar,
-    '='		=> \&clone,
-);
-
-sub new {
-    my ($self, $string) = @_;
-    my $class = ref($self) || $self;
-
-    my $obj = {
-	string  => [split(//,$string)],
-	current => 0,
-    };
-    return bless $obj, $class;
-}
-
-sub thischar {
-    my ($self) = @_;
-    my $last = $#{$self->{string}};
-    my $curr = $self->{current};
-    if ($curr >= 0 && $curr <= $last) {
-	return $self->{string}->[$curr];
-    }
-    else {
-	return '';
-    }
-}
-
-sub increment {
-    my ($self) = @_;
-    $self->{current}++;
-}
-
-sub decrement {
-    my ($self) = @_;
-    $self->{current}--;
-}
-
-sub plus {
-    my ($self, $offset) = @_;
-    my $rself = $self->clone;
-    $rself->{current} += $offset;
-    return $rself;
-}
-
-sub minus {
-    my ($self, $offset) = @_;
-    my $rself = $self->clone;
-    $rself->{current} -= $offset;
-    return $rself;
-}
-
-sub multiply {
-    my ($left, $right, $swapped) = @_;
-    my $char = $left->thischar();
-    return $char * $right;
-}
-
-sub spaceship {
-    my ($left, $right, $swapped) = @_;
-    unless (ref($right)) { # not an object already
-	$right = $left->new($right);
-    }
-    return $left->{current} <=> $right->{current};
-}
-
-sub cmp {
-    my ($left, $right, $swapped) = @_;
-    unless (ref($right)) { # not an object already
-	if (length($right) == 1) { # comparing single character only
-	    return $left->thischar cmp $right;
-	}
-	$right = $left->new($right);
-    }
-    return $left->currstr cmp $right->currstr;
-}
-
-sub bool {
-    my ($self) = @_;
-    my $char = $self->thischar;
-    return ($char ne '');
-}
-
-sub clone {
-    my ($left, $right, $swapped) = @_;
-    $right = {
-	string  => [@{$left->{string}}],
-	current => $left->{current},
-    };
-    return bless $right, ref($left);
-}
-
-sub currstr {
-    my ($self, $s) = @_;
-    my $curr = $self->{current};
-    my $last = $#{$self->{string}};
-    if (defined($s) && $s->{current} < $last) {
-	$last = $s->{current};
-    }
-
-    my $string = join('', @{$self->{string}}[$curr..$last]);
-    return $string;
-}
-
-package version::vpp;
-use strict;
-
-use POSIX qw/locale_h/;
-use locale;
-use vars qw ($VERSION @ISA @REGEXS);
-$VERSION = 0.88;
-
-use overload (
-    '""'       => \&stringify,
-    '0+'       => \&numify,
-    'cmp'      => \&vcmp,
-    '<=>'      => \&vcmp,
-    'bool'     => \&vbool,
-    'nomethod' => \&vnoop,
-);
-
-eval "use warnings";
-if ($@) {
-    eval '
-	package warnings;
-	sub enabled {return $^W;}
-	1;
-    ';
-}
-
-my $VERSION_MAX = 0x7FFFFFFF;
-
-# implement prescan_version as closely to the C version as possible
-use constant TRUE  => 1;
-use constant FALSE => 0;
-
-sub isDIGIT {
-    my ($char) = shift->thischar();
-    return ($char =~ /\d/);
-}
-
-sub isALPHA {
-    my ($char) = shift->thischar();
-    return ($char =~ /[a-zA-Z]/);
-}
-
-sub isSPACE {
-    my ($char) = shift->thischar();
-    return ($char =~ /\s/);
-}
-
-sub BADVERSION {
-    my ($s, $errstr, $error) = @_;
-    if ($errstr) {
-	$$errstr = $error;
-    }
-    return $s;
-}
-
-sub prescan_version {
-    my ($s, $strict, $errstr, $sqv, $ssaw_decimal, $swidth, $salpha) = @_;
-    my $qv          = defined $sqv          ? $$sqv          : FALSE;
-    my $saw_decimal = defined $ssaw_decimal ? $$ssaw_decimal : 0;
-    my $width       = defined $swidth       ? $$swidth       : 3;
-    my $alpha       = defined $salpha       ? $$salpha       : FALSE;
-
-    my $d = $s;
-
-    if ($qv && isDIGIT($d)) {
-	goto dotted_decimal_version;
-    }
-
-    if ($d eq 'v') { # explicit v-string
-	$d++;
-	if (isDIGIT($d)) {
-	    $qv = TRUE;
-	}
-	else { # degenerate v-string
-	    # requires v1.2.3
-	    return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
-	}
-
-dotted_decimal_version:
-	if ($strict && $d eq '0' && isDIGIT($d+1)) {
-	    # no leading zeros allowed
-	    return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)");
-	}
-
-	while (isDIGIT($d)) { 	# integer part
-	    $d++;
-	}
-
-	if ($d eq '.')
-	{
-	    $saw_decimal++;
-	    $d++; 		# decimal point
-	}
-	else
-	{
-	    if ($strict) {
-		# require v1.2.3
-		return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
-	    }
-	    else {
-		goto version_prescan_finish;
-	    }
-	}
-
-	{
-	    my $i = 0;
-	    my $j = 0;
-	    while (isDIGIT($d)) {	# just keep reading
-		$i++;
-		while (isDIGIT($d)) {
-		    $d++; $j++;
-		    # maximum 3 digits between decimal
-		    if ($strict && $j > 3) {
-			return BADVERSION($s,$errstr,"Invalid version format (maximum 3 digits between decimals)");
-		    }
-		}
-		if ($d eq '_') {
-		    if ($strict) {
-			return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
-		    }
-		    if ( $alpha ) {
-			return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)");
-		    }
-		    $d++;
-		    $alpha = TRUE;
-		}
-		elsif ($d eq '.') {
-		    if ($alpha) {
-			return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)");
-		    }
-		    $saw_decimal++;
-		    $d++;
-		}
-		elsif (!isDIGIT($d)) {
-		    last;
-		}
-		$j = 0;
-	    }
-	
-	    if ($strict && $i < 2) {
-		# requires v1.2.3
-		return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
-	    }
-	}
-    } 					# end if dotted-decimal
-    else
-    {					# decimal versions
-	# special $strict case for leading '.' or '0'
-	if ($strict) {
-	    if ($d eq '.') {
-		return BADVERSION($s,$errstr,"Invalid version format (0 before decimal required)");
-	    }
-	    if ($d eq '0' && isDIGIT($d+1)) {
-		return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)");
-	    }
-	}
-
-	# consume all of the integer part
-	while (isDIGIT($d)) {
-	    $d++;
-	}
-
-	# look for a fractional part
-	if ($d eq '.') {
-	    # we found it, so consume it
-	    $saw_decimal++;
-	    $d++;
-	}
-	elsif (!$d || $d eq ';' || isSPACE($d) || $d eq '}') {
-	    if ( $d == $s ) {
-		# found nothing
-		return BADVERSION($s,$errstr,"Invalid version format (version required)");
-	    }
-	    # found just an integer
-	    goto version_prescan_finish;
-	}
-	elsif ( $d == $s ) {
-	    # didn't find either integer or period
-	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
-	}
-	elsif ($d eq '_') {
-	    # underscore can't come after integer part
-	    if ($strict) {
-		return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
-	    }
-	    elsif (isDIGIT($d+1)) {
-		return BADVERSION($s,$errstr,"Invalid version format (alpha without decimal)");
-	    }
-	    else {
-		return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)");
-	    }
-	}
-	elsif ($d) {
-	    # anything else after integer part is just invalid data
-	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
-	}
-
-	# scan the fractional part after the decimal point
-	if ($d && !isDIGIT($d) && ($strict || ! ($d eq ';' || isSPACE($d) || $d eq '}') )) {
-		# $strict or lax-but-not-the-end
-		return BADVERSION($s,$errstr,"Invalid version format (fractional part required)");
-	}
-
-	while (isDIGIT($d)) {
-	    $d++;
-	    if ($d eq '.' && isDIGIT($d-1)) {
-		if ($alpha) {
-		    return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)");
-		}
-		if ($strict) {
-		    return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions must begin with 'v')");
-		}
-		$d = $s; # start all over again
-		$qv = TRUE;
-		goto dotted_decimal_version;
-	    }
-	    if ($d eq '_') {
-		if ($strict) {
-		    return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
-		}
-		if ( $alpha ) {
-		    return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)");
-		}
-		if ( ! isDIGIT($d+1) ) {
-		    return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)");
-		}
-		$d++;
-		$alpha = TRUE;
-	    }
-	}
-    }
-
-version_prescan_finish:
-    while (isSPACE($d)) {
-	$d++;
-    }
-
-    if ($d && !isDIGIT($d) && (! ($d eq ';' || $d eq '}') )) {
-	# trailing non-numeric data
-	return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
-    }
-
-    if (defined $sqv) {
-	$$sqv = $qv;
-    }
-    if (defined $swidth) {
-	$$swidth = $width;
-    }
-    if (defined $ssaw_decimal) {
-	$$ssaw_decimal = $saw_decimal;
-    }
-    if (defined $salpha) {
-	$$salpha = $alpha;
-    }
-    return $d;
-}
-
-sub scan_version {
-    my ($s, $rv, $qv) = @_;
-    my $start;
-    my $pos;
-    my $last;
-    my $errstr;
-    my $saw_decimal = 0;
-    my $width = 3;
-    my $alpha = FALSE;
-    my $vinf = FALSE;
-    my @av;
-
-    $s = new charstar $s;
-
-    while (isSPACE($s)) { # leading whitespace is OK
-	$s++;
-    }
-
-    $last = prescan_version($s, FALSE, \$errstr, \$qv, \$saw_decimal,
-	\$width, \$alpha);
-
-    if ($errstr) {
-	# 'undef' is a special case and not an error
-	if ( $s ne 'undef') {
-	    use Carp;
-	    Carp::croak($errstr);
-	}
-    }
-
-    $start = $s;
-    if ($s eq 'v') {
-	$s++;
-    }
-    $pos = $s;
-
-    if ( $qv ) {
-	$$rv->{qv} = $qv;
-    }
-    if ( $alpha ) {
-	$$rv->{alpha} = $alpha;
-    }
-    if ( !$qv && $width < 3 ) {
-	$$rv->{width} = $width;
-    }
-    
-    while (isDIGIT($pos)) {
-	$pos++;
-    }
-    if (!isALPHA($pos)) {
-	my $rev;
-
-	for (;;) {
-	    $rev = 0;
-	    {
-  		# this is atoi() that delimits on underscores
-  		my $end = $pos;
-  		my $mult = 1;
-		my $orev;
-
-		#  the following if() will only be true after the decimal
-		#  point of a version originally created with a bare
-		#  floating point number, i.e. not quoted in any way
-		#
- 		if ( !$qv && $s > $start && $saw_decimal == 1 ) {
-		    $mult *= 100;
- 		    while ( $s < $end ) {
-			$orev = $rev;
- 			$rev += $s * $mult;
- 			$mult /= 10;
-			if (   (abs($orev) > abs($rev)) 
-			    || (abs($rev) > $VERSION_MAX )) {
-			    warn("Integer overflow in version %d",
-					   $VERSION_MAX);
-			    $s = $end - 1;
-			    $rev = $VERSION_MAX;
-			    $vinf = 1;
-			}
- 			$s++;
-			if ( $s eq '_' ) {
-			    $s++;
-			}
- 		    }
-  		}
- 		else {
- 		    while (--$end >= $s) {
-			$orev = $rev;
- 			$rev += $end * $mult;
- 			$mult *= 10;
-			if (   (abs($orev) > abs($rev)) 
-			    || (abs($rev) > $VERSION_MAX )) {
-			    warn("Integer overflow in version");
-			    $end = $s - 1;
-			    $rev = $VERSION_MAX;
-			    $vinf = 1;
-			}
- 		    }
- 		} 
-  	    }
-
-  	    # Append revision
-	    push @av, $rev;
-	    if ( $vinf ) {
-		$s = $last;
-		last;
-	    }
-	    elsif ( $pos eq '.' ) {
-		$s = ++$pos;
-	    }
-	    elsif ( $pos eq '_' && isDIGIT($pos+1) ) {
-		$s = ++$pos;
-	    }
-	    elsif ( $pos eq ',' && isDIGIT($pos+1) ) {
-		$s = ++$pos;
-	    }
-	    elsif ( isDIGIT($pos) ) {
-		$s = $pos;
-	    }
-	    else {
-		$s = $pos;
-		last;
-	    }
-	    if ( $qv ) {
-		while ( isDIGIT($pos) ) {
-		    $pos++;
-		}
-	    }
-	    else {
-		my $digits = 0;
-		while ( ( isDIGIT($pos) || $pos eq '_' ) && $digits < 3 ) {
-		    if ( $pos ne '_' ) {
-			$digits++;
-		    }
-		    $pos++;
-		}
-	    }
-	}
-    }
-    if ( $qv ) { # quoted versions always get at least three terms
-	my $len = $#av;
-	#  This for loop appears to trigger a compiler bug on OS X, as it
-	#  loops infinitely. Yes, len is negative. No, it makes no sense.
-	#  Compiler in question is:
-	#  gcc version 3.3 20030304 (Apple Computer, Inc. build 1640)
-	#  for ( len = 2 - len; len > 0; len-- )
-	#  av_push(MUTABLE_AV(sv), newSViv(0));
-	# 
-	$len = 2 - $len;
-	while ($len-- > 0) {
-	    push @av, 0;
-	}
-    }
-
-    # need to save off the current version string for later
-    if ( $vinf ) {
-	$$rv->{original} = "v.Inf";
-	$$rv->{vinf} = 1;
-    }
-    elsif ( $s > $start ) {
-	$$rv->{original} = $start->currstr($s);
-	if ( $qv && $saw_decimal == 1 && $start ne 'v' ) {
-	    # need to insert a v to be consistent
-	    $$rv->{original} = 'v' . $$rv->{original};
-	}
-    }
-    else {
-	$$rv->{original} = '0';
-	push(@av, 0);
-    }
-
-    # And finally, store the AV in the hash
-    $$rv->{version} = \@av;
-
-    # fix RT#19517 - special case 'undef' as string
-    if ($s eq 'undef') {
-	$s += 5;
-    }
-
-    return $s;
-}
-
-sub new
-{
-	my ($class, $value) = @_;
-	my $self = bless ({}, ref ($class) || $class);
-	my $qv = FALSE;
-	
-	if ( ref($value) && eval('$value->isa("version")') ) {
-	    # Can copy the elements directly
-	    $self->{version} = [ @{$value->{version} } ];
-	    $self->{qv} = 1 if $value->{qv};
-	    $self->{alpha} = 1 if $value->{alpha};
-	    $self->{original} = ''.$value->{original};
-	    return $self;
-	}
-
-	my $currlocale = setlocale(LC_ALL);
-
-	# if the current locale uses commas for decimal points, we
-	# just replace commas with decimal places, rather than changing
-	# locales
-	if ( localeconv()->{decimal_point} eq ',' ) {
-	    $value =~ tr/,/./;
-	}
-
-	if ( not defined $value or $value =~ /^undef$/ ) {
-	    # RT #19517 - special case for undef comparison
-	    # or someone forgot to pass a value
-	    push @{$self->{version}}, 0;
-	    $self->{original} = "0";
-	    return ($self);
-	}
-
-	if ( $#_ == 2 ) { # must be CVS-style
-	    $value = $_[2];
-	    $qv = TRUE;
-	}
-
-	$value = _un_vstring($value);
-
-	# exponential notation
-	if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
-	    $value = sprintf("%.9f",$value);
-	    $value =~ s/(0+)$//; # trim trailing zeros
-	}
-	
-	my $s = scan_version($value, \$self, $qv);
-
-	if ($s) { # must be something left over
-	    warn("Version string '%s' contains invalid data; "
-                       ."ignoring: '%s'", $value, $s);
-	}
-
-	return ($self);
-}
-
-*parse = \&new;
-
-sub numify 
-{
-    my ($self) = @_;
-    unless (_verify($self)) {
-	require Carp;
-	Carp::croak("Invalid version object");
-    }
-    my $width = $self->{width} || 3;
-    my $alpha = $self->{alpha} || "";
-    my $len = $#{$self->{version}};
-    my $digit = $self->{version}[0];
-    my $string = sprintf("%d.", $digit );
-
-    for ( my $i = 1 ; $i < $len ; $i++ ) {
-	$digit = $self->{version}[$i];
-	if ( $width < 3 ) {
-	    my $denom = 10**(3-$width);
-	    my $quot = int($digit/$denom);
-	    my $rem = $digit - ($quot * $denom);
-	    $string .= sprintf("%0".$width."d_%d", $quot, $rem);
-	}
-	else {
-	    $string .= sprintf("%03d", $digit);
-	}
-    }
-
-    if ( $len > 0 ) {
-	$digit = $self->{version}[$len];
-	if ( $alpha && $width == 3 ) {
-	    $string .= "_";
-	}
-	$string .= sprintf("%0".$width."d", $digit);
-    }
-    else # $len = 0
-    {
-	$string .= sprintf("000");
-    }
-
-    return $string;
-}
-
-sub normal 
-{
-    my ($self) = @_;
-    unless (_verify($self)) {
-	require Carp;
-	Carp::croak("Invalid version object");
-    }
-    my $alpha = $self->{alpha} || "";
-    my $len = $#{$self->{version}};
-    my $digit = $self->{version}[0];
-    my $string = sprintf("v%d", $digit );
-
-    for ( my $i = 1 ; $i < $len ; $i++ ) {
-	$digit = $self->{version}[$i];
-	$string .= sprintf(".%d", $digit);
-    }
-
-    if ( $len > 0 ) {
-	$digit = $self->{version}[$len];
-	if ( $alpha ) {
-	    $string .= sprintf("_%0d", $digit);
-	}
-	else {
-	    $string .= sprintf(".%0d", $digit);
-	}
-    }
-
-    if ( $len <= 2 ) {
-	for ( $len = 2 - $len; $len != 0; $len-- ) {
-	    $string .= sprintf(".%0d", 0);
-	}
-    }
-
-    return $string;
-}
-
-sub stringify
-{
-    my ($self) = @_;
-    unless (_verify($self)) {
-	require Carp;
-	Carp::croak("Invalid version object");
-    }
-    return exists $self->{original} 
-    	? $self->{original} 
-	: exists $self->{qv} 
-	    ? $self->normal
-	    : $self->numify;
-}
-
-sub vcmp
-{
-    require UNIVERSAL;
-    my ($left,$right,$swap) = @_;
-    my $class = ref($left);
-    unless ( UNIVERSAL::isa($right, $class) ) {
-	$right = $class->new($right);
-    }
-
-    if ( $swap ) {
-	($left, $right) = ($right, $left);
-    }
-    unless (_verify($left)) {
-	require Carp;
-	Carp::croak("Invalid version object");
-    }
-    unless (_verify($right)) {
-	require Carp;
-	Carp::croak("Invalid version object");
-    }
-    my $l = $#{$left->{version}};
-    my $r = $#{$right->{version}};
-    my $m = $l < $r ? $l : $r;
-    my $lalpha = $left->is_alpha;
-    my $ralpha = $right->is_alpha;
-    my $retval = 0;
-    my $i = 0;
-    while ( $i <= $m && $retval == 0 ) {
-	$retval = $left->{version}[$i] <=> $right->{version}[$i];
-	$i++;
-    }
-
-    # tiebreaker for alpha with identical terms
-    if ( $retval == 0 
-	&& $l == $r 
-	&& $left->{version}[$m] == $right->{version}[$m]
-	&& ( $lalpha || $ralpha ) ) {
-
-	if ( $lalpha && !$ralpha ) {
-	    $retval = -1;
-	}
-	elsif ( $ralpha && !$lalpha) {
-	    $retval = +1;
-	}
-    }
-
-    # possible match except for trailing 0's
-    if ( $retval == 0 && $l != $r ) {
-	if ( $l < $r ) {
-	    while ( $i <= $r && $retval == 0 ) {
-		if ( $right->{version}[$i] != 0 ) {
-		    $retval = -1; # not a match after all
-		}
-		$i++;
-	    }
-	}
-	else {
-	    while ( $i <= $l && $retval == 0 ) {
-		if ( $left->{version}[$i] != 0 ) {
-		    $retval = +1; # not a match after all
-		}
-		$i++;
-	    }
-	}
-    }
-
-    return $retval;  
-}
-
-sub vbool {
-    my ($self) = @_;
-    return vcmp($self,$self->new("0"),1);
-}
-
-sub vnoop { 
-    require Carp; 
-    Carp::croak("operation not supported with version object");
-}
-
-sub is_alpha {
-    my ($self) = @_;
-    return (exists $self->{alpha});
-}
-
-sub qv {
-    my $value = shift;
-    my $class = 'version';
-    if (@_) {
-	$class = ref($value) || $value;
-	$value = shift;
-    }
-
-    $value = _un_vstring($value);
-    $value = 'v'.$value unless $value =~ /(^v|\d+\.\d+\.\d)/;
-    my $version = $class->new($value);
-    return $version;
-}
-
-*declare = \&qv;
-
-sub is_qv {
-    my ($self) = @_;
-    return (exists $self->{qv});
-}
-
-
-sub _verify {
-    my ($self) = @_;
-    if ( ref($self)
-	&& eval { exists $self->{version} }
-	&& ref($self->{version}) eq 'ARRAY'
-	) {
-	return 1;
-    }
-    else {
-	return 0;
-    }
-}
-
-sub _is_non_alphanumeric {
-    my $s = shift;
-    $s = new charstar $s;
-    while ($s) {
-	return 0 if isSPACE($s); # early out
-	return 1 unless (isALPHA($s) || isDIGIT($s) || $s =~ /[.-]/);
-	$s++;
-    }
-    return 0;
-}
-
-sub _un_vstring {
-    my $value = shift;
-    # may be a v-string
-    if ( length($value) >= 3 && $value !~ /[._]/ 
-	&& _is_non_alphanumeric($value)) {
-	my $tvalue;
-	if ( $] ge 5.008_001 ) {
-	    $tvalue = _find_magic_vstring($value);
-	    $value = $tvalue if length $tvalue;
-	}
-	elsif ( $] ge 5.006_000 ) {
-	    $tvalue = sprintf("v%vd",$value);
-	    if ( $tvalue =~ /^v\d+(\.\d+){2,}$/ ) {
-		# must be a v-string
-		$value = $tvalue;
-	    }
-	}
-    }
-    return $value;
-}
-
-sub _find_magic_vstring {
-    my $value = shift;
-    my $tvalue = '';
-    require B;
-    my $sv = B::svref_2object(\$value);
-    my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
-    while ( $magic ) {
-	if ( $magic->TYPE eq 'V' ) {
-	    $tvalue = $magic->PTR;
-	    $tvalue =~ s/^v?(.+)$/v$1/;
-	    last;
-	}
-	else {
-	    $magic = $magic->MOREMAGIC;
-	}
-    }
-    return $tvalue;
-}
-
-sub _VERSION {
-    my ($obj, $req) = @_;
-    my $class = ref($obj) || $obj;
-
-    no strict 'refs';
-    if ( exists $INC{"$class.pm"} and not %{"$class\::"} and $] >= 5.008) {
-	 # file but no package
-	require Carp;
-	Carp::croak( "$class defines neither package nor VERSION"
-	    ."--version check failed");
-    }
-
-    my $version = eval "\$$class\::VERSION";
-    if ( defined $version ) {
-	local $^W if $] <= 5.008;
-	$version = version::vpp->new($version);
-    }
-
-    if ( defined $req ) {
-	unless ( defined $version ) {
-	    require Carp;
-	    my $msg =  $] < 5.006 
-	    ? "$class version $req required--this is only version "
-	    : "$class does not define \$$class\::VERSION"
-	      ."--version check failed";
-
-	    if ( $ENV{VERSION_DEBUG} ) {
-		Carp::confess($msg);
-	    }
-	    else {
-		Carp::croak($msg);
-	    }
-	}
-
-	$req = version::vpp->new($req);
-
-	if ( $req > $version ) {
-	    require Carp;
-	    if ( $req->is_qv ) {
-		Carp::croak( 
-		    sprintf ("%s version %s required--".
-			"this is only version %s", $class,
-			$req->normal, $version->normal)
-		);
-	    }
-	    else {
-		Carp::croak( 
-		    sprintf ("%s version %s required--".
-			"this is only version %s", $class,
-			$req->stringify, $version->stringify)
-		);
-	    }
-	}
-    }
-
-    return defined $version ? $version->stringify : undef;
-}
-
-1; #this line is important and will help the module return a true value
@@ -1,213 +0,0 @@
-#!perl -w
-package version;
-
-use 5.005_04;
-use strict;
-
-use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
-
-$VERSION = 0.88;
-
-$CLASS = 'version';
-
-#--------------------------------------------------------------------------#
-# Version regexp components
-#--------------------------------------------------------------------------#
-
-# Fraction part of a decimal version number.  This is a common part of
-# both strict and lax decimal versions
-
-my $FRACTION_PART = qr/\.[0-9]+/;
-
-# First part of either decimal or dotted-decimal strict version number.
-# Unsigned integer with no leading zeroes (except for zero itself) to
-# avoid confusion with octal.
-
-my $STRICT_INTEGER_PART = qr/0|[1-9][0-9]*/;
-
-# First part of either decimal or dotted-decimal lax version number.
-# Unsigned integer, but allowing leading zeros.  Always interpreted
-# as decimal.  However, some forms of the resulting syntax give odd
-# results if used as ordinary Perl expressions, due to how perl treats
-# octals.  E.g.
-#   version->new("010" ) == 10
-#   version->new( 010  ) == 8
-#   version->new( 010.2) == 82  # "8" . "2"
-
-my $LAX_INTEGER_PART = qr/[0-9]+/;
-
-# Second and subsequent part of a strict dotted-decimal version number.
-# Leading zeroes are permitted, and the number is always decimal.
-# Limited to three digits to avoid overflow when converting to decimal
-# form and also avoid problematic style with excessive leading zeroes.
-
-my $STRICT_DOTTED_DECIMAL_PART = qr/\.[0-9]{1,3}/;
-
-# Second and subsequent part of a lax dotted-decimal version number.
-# Leading zeroes are permitted, and the number is always decimal.  No
-# limit on the numerical value or number of digits, so there is the
-# possibility of overflow when converting to decimal form.
-
-my $LAX_DOTTED_DECIMAL_PART = qr/\.[0-9]+/;
-
-# Alpha suffix part of lax version number syntax.  Acts like a
-# dotted-decimal part.
-
-my $LAX_ALPHA_PART = qr/_[0-9]+/;
-
-#--------------------------------------------------------------------------#
-# Strict version regexp definitions
-#--------------------------------------------------------------------------#
-
-# Strict decimal version number.
-
-my $STRICT_DECIMAL_VERSION =
-    qr/ $STRICT_INTEGER_PART $FRACTION_PART? /x;
-
-# Strict dotted-decimal version number.  Must have both leading "v" and
-# at least three parts, to avoid confusion with decimal syntax.
-
-my $STRICT_DOTTED_DECIMAL_VERSION =
-    qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} /x;
-
-# Complete strict version number syntax -- should generally be used
-# anchored: qr/ \A $STRICT \z /x
-
-$STRICT =
-    qr/ $STRICT_DECIMAL_VERSION | $STRICT_DOTTED_DECIMAL_VERSION /x;
-
-#--------------------------------------------------------------------------#
-# Lax version regexp definitions
-#--------------------------------------------------------------------------#
-
-# Lax decimal version number.  Just like the strict one except for
-# allowing an alpha suffix or allowing a leading or trailing
-# decimal-point
-
-my $LAX_DECIMAL_VERSION =
-    qr/ $LAX_INTEGER_PART (?: \. | $FRACTION_PART $LAX_ALPHA_PART? )?
-	|
-	$FRACTION_PART $LAX_ALPHA_PART?
-    /x;
-
-# Lax dotted-decimal version number.  Distinguished by having either
-# leading "v" or at least three non-alpha parts.  Alpha part is only
-# permitted if there are at least two non-alpha parts. Strangely
-# enough, without the leading "v", Perl takes .1.2 to mean v0.1.2,
-# so when there is no "v", the leading part is optional
-
-my $LAX_DOTTED_DECIMAL_VERSION =
-    qr/
-	v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )?
-	|
-	$LAX_INTEGER_PART? $LAX_DOTTED_DECIMAL_PART{2,} $LAX_ALPHA_PART?
-    /x;
-
-# Complete lax version number syntax -- should generally be used
-# anchored: qr/ \A $LAX \z /x
-#
-# The string 'undef' is a special case to make for easier handling
-# of return values from ExtUtils::MM->parse_version
-
-$LAX =
-    qr/ undef | $LAX_DECIMAL_VERSION | $LAX_DOTTED_DECIMAL_VERSION /x;
-
-#--------------------------------------------------------------------------#
-
-eval "use version::vxs $VERSION";
-if ( $@ ) { # don't have the XS version installed
-    eval "use version::vpp $VERSION"; # don't tempt fate
-    die "$@" if ( $@ );
-    push @ISA, "version::vpp";
-    local $^W;
-    *version::qv = \&version::vpp::qv;
-    *version::declare = \&version::vpp::declare;
-    *version::_VERSION = \&version::vpp::_VERSION;
-    if ($] >= 5.009000 && $] < 5.011004) {
-	no strict 'refs';
-	*version::stringify = \&version::vpp::stringify;
-	*{'version::(""'} = \&version::vpp::stringify;
-	*version::new = \&version::vpp::new;
-	*version::parse = \&version::vpp::parse;
-    }
-}
-else { # use XS module
-    push @ISA, "version::vxs";
-    local $^W;
-    *version::declare = \&version::vxs::declare;
-    *version::qv = \&version::vxs::qv;
-    *version::_VERSION = \&version::vxs::_VERSION;
-    *version::vcmp = \&version::vxs::VCMP;
-    if ($] >= 5.009000 && $] < 5.011004) {
-	no strict 'refs';
-	*version::stringify = \&version::vxs::stringify;
-	*{'version::(""'} = \&version::vxs::stringify;
-	*version::new = \&version::vxs::new;
-	*version::parse = \&version::vxs::parse;
-    }
-
-}
-
-# Preloaded methods go here.
-sub import {
-    no strict 'refs';
-    my ($class) = shift;
-
-    # Set up any derived class
-    unless ($class eq 'version') {
-	local $^W;
-	*{$class.'::declare'} =  \&version::declare;
-	*{$class.'::qv'} = \&version::qv;
-    }
-
-    my %args;
-    if (@_) { # any remaining terms are arguments
-	map { $args{$_} = 1 } @_
-    }
-    else { # no parameters at all on use line
-    	%args = 
-	(
-	    qv => 1,
-	    'UNIVERSAL::VERSION' => 1,
-	);
-    }
-
-    my $callpkg = caller();
-    
-    if (exists($args{declare})) {
-	*{$callpkg.'::declare'} = 
-	    sub {return $class->declare(shift) }
-	  unless defined(&{$callpkg.'::declare'});
-    }
-
-    if (exists($args{qv})) {
-	*{$callpkg.'::qv'} =
-	    sub {return $class->qv(shift) }
-	  unless defined(&{$callpkg.'::qv'});
-    }
-
-    if (exists($args{'UNIVERSAL::VERSION'})) {
-	local $^W;
-	*UNIVERSAL::VERSION 
-		= \&version::_VERSION;
-    }
-
-    if (exists($args{'VERSION'})) {
-	*{$callpkg.'::VERSION'} = \&version::_VERSION;
-    }
-
-    if (exists($args{'is_strict'})) {
-	*{$callpkg.'::is_strict'} = \&version::is_strict
-	  unless defined(&{$callpkg.'::is_strict'});
-    }
-
-    if (exists($args{'is_lax'})) {
-	*{$callpkg.'::is_lax'} = \&version::is_lax
-	  unless defined(&{$callpkg.'::is_lax'});
-    }
-}
-
-sub is_strict	{ defined $_[0] && $_[0] =~ qr/ \A $STRICT \z /x }
-sub is_lax	{ defined $_[0] && $_[0] =~ qr/ \A $LAX \z /x }
-
-1;
@@ -1,321 +0,0 @@
-=head1 NAME
-
-version - Perl extension for Version Objects
-
-=head1 SYNOPSIS
-
-  # Parsing version strings (decimal or dotted-decimal)
-
-  use version 0.77; # get latest bug-fixes and API
-  $ver = version->parse($string)
-
-  # Declaring a dotted-decimal $VERSION (keep on one line!)
-
-  use version 0.77; our $VERSION = version->declare("v1.2.3"); # formal
-  use version 0.77; our $VERSION = qv("v1.2.3");               # shorthand
-  use version 0.77; our $VERSION = qv("v1.2_3");               # alpha
-
-  # Declaring an old-style decimal $VERSION (use quotes!)
-
-  our $VERSION = "1.0203";                                     # recommended
-  use version 0.77; our $VERSION = version->parse("1.0203");   # formal
-  use version 0.77; our $VERSION = version->parse("1.02_03");  # alpha
-
-  # Comparing mixed version styles (decimals, dotted-decimals, objects)
-
-  if ( version->parse($v1) == version->parse($v2) ) {
-    # do stuff
-  }
-
-  # Sorting mixed version styles
-
-  @ordered = sort { version->parse($a) <=> version->parse($b) } @list;
-
-=head1 DESCRIPTION
-
-Version objects were added to Perl in 5.10.  This module implements version
-objects for older version of Perl and provides the version object API for all
-versions of Perl.  All previous releases before 0.74 are deprecated and should
-not be used due to incompatible API changes.  Version 0.77 introduces the new
-'parse' and 'declare' methods to standardize usage.  You are strongly urged to
-set 0.77 as a minimum in your code, e.g.
-
-  use version 0.77; # even for Perl v.5.10.0
-
-=head1 TYPES OF VERSION OBJECTS
-
-There are two different types of version objects, corresponding to the two
-different styles of versions in use:
-
-=over 2
-
-=item Decimal Versions
-
-The classic floating-point number $VERSION.  The advantage to this style is
-that you don't need to do anything special, just type a number into your
-source file.  Quoting is recommended, as it ensures that trailing zeroes
-("1.50") are preserved in any warnings or other output.
-
-=item Dotted Decimal Versions
-
-The more modern form of version assignment, with 3 (or potentially more)
-integers separated by decimal points (e.g. v1.2.3).  This is the form that
-Perl itself has used since 5.6.0 was released.  The leading "v" is now
-strongly recommended for clarity, and will throw a warning in a future
-release if omitted.
-
-=back
-
-=head1 DECLARING VERSIONS
-
-If you have a module that uses a decimal $VERSION (floating point), and you
-do not intend to ever change that, this module is not for you.  There is
-nothing that version.pm gains you over a simple $VERSION assignment:
-
-  our $VERSION = "1.02";
-
-Since Perl v5.10.0 includes the version.pm comparison logic anyways,
-you don't need to do anything at all.
-
-=head2 How to convert a module from decimal to dotted-decimal
-
-If you have used a decimal $VERSION in the past and wish to switch to a
-dotted-decimal $VERSION, then you need to make a one-time conversion to
-the new format.
-
-B<Important Note>: you must ensure that your new $VERSION is numerically
-greater than your current decimal $VERSION; this is not always obvious. First,
-convert your old decimal version (e.g. 1.02) to a normalized dotted-decimal
-form:
-
-  $ perl -Mversion -e 'print version->parse("1.02")->normal'
-  v1.20.0
-
-Then increment any of the dotted-decimal components (v1.20.1 or v1.21.0).
-
-=head2 How to C<declare()> a dotted-decimal version
-
-  use version 0.77; our $VERSION = version->declare("v1.2.3");
-
-The C<declare()> method always creates dotted-decimal version objects.  When
-used in a module, you B<must> put it on the same line as "use version" to
-ensure that $VERSION is read correctly by PAUSE and installer tools.  You
-should also add 'version' to the 'configure_requires' section of your
-module metadata file.  See instructions in L<ExtUtils::MakeMaker> or
-L<Module::Build> for details.
-
-B<Important Note>: Even if you pass in what looks like a decimal number
-("1.2"), a dotted-decimal will be created ("v1.200.0"). To avoid confusion
-or unintentional errors on older Perls, follow these guidelines:
-
-=over 2
-
-=item *
-
-Always use a dotted-decimal with (at least) three components
-
-=item *
-
-Always use a leading-v
-
-=item *
-
-Always quote the version
-
-=back
-
-If you really insist on using version.pm with an ordinary decimal version,
-use C<parse()> instead of declare.  See the L<PARSING AND COMPARING VERSIONS>
-for details.
-
-See also L<version::Internals> for more on version number conversion,
-quoting, calculated version numbers and declaring developer or "alpha" version
-numbers.
-
-=head1 PARSING AND COMPARING VERSIONS
-
-If you need to compare version numbers, but can't be sure whether they are
-expressed as numbers, strings, v-strings or version objects,  then you should
-use version.pm to parse them all into objects for comparison.
-
-=head2 How to C<parse()> a version
-
-The C<parse()> method takes in anything that might be a version and returns
-a corresponding version object, doing any necessary conversion along the way.
-
-=over 2
-
-=item *
-
-Dotted-decimal: bare v-strings (v1.2.3) and strings with more than one
-decimal point and a leading 'v' ("v1.2.3"); NOTE you can technically use a
-v-string or strings with a leading-v and only one decimal point (v1.2 or
-"v1.2"), but you will confuse both yourself and others.
-
-=item *
-
-Decimal: regular decimal numbers (literal or in a string)
-
-=back
-
-Some examples:
-
-  $variable   version->parse($variable)
-  ---------   -------------------------
-  1.23        v1.230.0
-  "1.23"      v1.230.0
-  v1.23       v1.23.0
-  "v1.23"     v1.23.0
-  "1.2.3"     v1.2.3
-  "v1.2.3"    v1.2.3
-
-See L<version::Internals> for more on version number conversion.
-
-=head2 How to check for a legal version string
-
-If you do not want to actually create a full blown version object, but
-would still like to verify that a given string meets the criteria to
-be parsed as a version, there are two helper functions that can be
-employed directly:
-
-=over 4
-
-=item C<is_lax()>
-
-The lax criteria corresponds to what is currently allowed by the
-version parser.  All of the following formats are acceptable
-for dotted-decimal formats strings:
-
-    v1.2
-    1.2345.6
-    v1.23_4
-    1.2345
-    1.2345_01
-
-=item C<is_strict()>
-
-If you want to limit youself to a much more narrow definition of what
-a version string constitutes, C<is_strict()> is limited to version
-strings like the following list:
-
-    v1.234.5
-    2.3456
-
-=back
-
-See L<version::Internals> for details of the regular expressions
-that define the legal version string forms, as well as how to use
-those regular expressions in your own code if C<is_lax()> and
-C<is_strict()> are not sufficient for your needs.
-
-=head2 How to compare version objects
-
-Version objects overload the C<cmp> and C<< <=> >> operators.  Perl
-automatically generates all of the other comparison operators based on those
-two so all the normal logical comparisons will work.
-
-  if ( version->parse($v1) == version->parse($v2) ) {
-    # do stuff
-  }
-
-If a version object is compared against a non-version object, the non-object
-term will be converted to a version object using C<parse()>.  This may give
-surprising results:
-
-  $v1 = version->parse("v0.95.0");
-  $bool = $v1 < 0.96; # FALSE since 0.96 is v0.960.0
-
-Always comparing to a version object will help avoid surprises:
-
-  $bool = $v1 < version->parse("v0.96.0"); # TRUE
-
-Note that "alpha" version objects (where the version string contains
-a trailing underscore segment) compare as less than the equivalent
-version without an underscore:
-
-  $bool = version->parse("1.23_45") < version->parse("1.2345"); # TRUE
-
-See L<version::Internals> for more details on "alpha" versions.
-
-=head1 OBJECT METHODS
-
-=head2 is_alpha()
-
-True if and only if the version object was created with a underscore, e.g.
-
-  version->parse('1.002_03')->is_alpha;  # TRUE
-  version->declare('1.2.3_4')->is_alpha; # TRUE
-
-=head2 is_qv()
-
-True only if the version object is a dotted-decimal version, e.g.
-
-  version->parse('v1.2.0')->is_qv;        # TRUE
-  version->declare('v1.2')->is_qv;       # TRUE
-  qv('1.2')->is_qv;                      # TRUE
-  version->parse('1.2')->is_qv;          # FALSE
-
-=head2 normal()
-
-Returns a string with a standard 'normalized' dotted-decimal form with a
-leading-v and at least 3 components.
-
- version->declare('v1.2')->normal;  # v1.2.0
- version->parse('1.2')->normal;     # v1.200.0
-
-=head2 numify()
-
-Returns a value representing the object in a pure decimal form without
-trailing zeroes.
-
- version->declare('v1.2')->numify;  # 1.002
- version->parse('1.2')->numify;     # 1.2
-
-=head2 stringify()
-
-Returns a string that is as close to the original representation as possible.
-If the original representation was a numeric literal, it will be returned the
-way perl would normally represent it in a string.  This method is used whenever
-a version object is interpolated into a string.
-
- version->declare('v1.2')->stringify;    # v1.2
- version->parse('1.200')->stringify;     # 1.200
- version->parse(1.02_30)->stringify;     # 1.023
-
-=head1 EXPORTED FUNCTIONS
-
-=head2 qv()
-
-This function is no longer recommended for use, but is maintained for
-compatibility with existing code.  If you do not want to have it exported
-to your namespace, use this form:
-
-  use version 0.77 ();
-
-=head2 is_lax()
-
-(Not exported by default)
-
-This function takes a scalar argument and returns a boolean value indicating
-whether the argument meets the "lax" rules for a version number.  Leading and
-trailing spaces are not allowed.
-
-=head2 is_strict()
-
-(Not exported by default)
-
-This function takes a scalar argument and returns a boolean value indicating
-whether the argument meets the "strict" rules for a version number.  Leading
-and trailing spaces are not allowed.
-
-=head1 AUTHOR
-
-John Peacock E<lt>jpeacock@cpan.orgE<gt>
-
-=head1 SEE ALSO
-
-L<version::Internals>.
-
-L<perl>.
-
-=cut
@@ -10,7 +10,7 @@ our @ISA = qw(Exporter);
 
 our @EXPORT  = qw(test_harness pod2man perllocal_install uninstall
                   warn_if_old_packlist test_s cp_nonempty);
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 my $Is_VMS = $^O eq 'VMS';
 
@@ -116,8 +116,9 @@ sub pod2man {
                 'section|s=s', 'release|r=s', 'center|c=s',
                 'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
                 'fixedbolditalic=s', 'official|o', 'quotes|q=s', 'lax|l',
-                'name|n=s', 'perm_rw=i'
+                'name|n=s', 'perm_rw=i', 'utf8|u'
     );
+    delete $options{utf8} unless $Pod::Man::VERSION >= 2.17;
 
     # If there's no files, don't bother going further.
     return 0 unless @ARGV;
@@ -130,6 +131,9 @@ sub pod2man {
     # This isn't a valid Pod::Man option and is only accepted for backwards
     # compatibility.
     delete $options{lax};
+    my $count = scalar @ARGV / 2;
+    my $plural = $count == 1 ? 'document' : 'documents';
+    print "Manifying $count pod $plural\n";
 
     do {{  # so 'next' works
         my ($pod, $man) = splice(@ARGV, 0, 2);
@@ -138,8 +142,6 @@ sub pod2man {
                  (mtime($man) > mtime($pod)) &&
                  (mtime($man) > mtime("Makefile")));
 
-        print "Manifying $man\n";
-
         my $parser = Pod::Man->new(%options);
         $parser->parse_from_file($pod, $man)
           or do { warn("Could not install $man\n");  next };
@@ -11,7 +11,7 @@ use 5.006;
 
 use strict;
 use warnings;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 use ExtUtils::MakeMaker::Config;
 use Cwd 'cwd';
@@ -49,7 +49,7 @@ sub _unix_os2_ext {
     # this is a rewrite of Andy Dougherty's extliblist in perl
 
     my ( @searchpath );    # from "-L/path" entries in $potential_libs
-    my ( @libpath ) = split " ", $Config{'libpth'};
+    my ( @libpath ) = split " ", $Config{'libpth'} || '';
     my ( @ldloadlibs, @bsloadlibs, @extralibs, @ld_run_path, %ld_run_path_seen );
     my ( @libs,       %libs_seen );
     my ( $fullname,   @fullname );
@@ -57,6 +57,7 @@ sub _unix_os2_ext {
     my ( $found ) = 0;
 
     foreach my $thislib ( split ' ', $potential_libs ) {
+        my ( $custom_name ) = '';
 
         # Handle possible linker path arguments.
         if ( $thislib =~ s/^(-[LR]|-Wl,-R|-Wl,-rpath,)// ) {    # save path flag type
@@ -92,7 +93,14 @@ sub _unix_os2_ext {
         }
 
         # Handle possible library arguments.
-        unless ( $thislib =~ s/^-l// ) {
+        if ( $thislib =~ s/^-l(:)?// ) {
+            # Handle -l:foo.so, which means that the library will
+            # actually be called foo.so, not libfoo.so.  This
+            # is used in Android by ExtUtils::Depends to allow one XS
+            # module to link to another.
+            $custom_name = $1 || '';
+        }
+        else {
             warn "Unrecognized argument in LIBS ignored: '$thislib'\n";
             next;
         }
@@ -106,8 +114,10 @@ sub _unix_os2_ext {
             # For gcc-2.6.2 on linux (March 1995), DLD can not load
             # .sa libraries, with the exception of libm.sa, so we
             # deliberately skip them.
-            if ( @fullname = $self->lsdir( $thispth, "^\Qlib$thislib.$so.\E[0-9]+" ) ) {
-
+            if ((@fullname =
+                 $self->lsdir($thispth, "^\Qlib$thislib.$so.\E[0-9]+")) ||
+                (@fullname =
+                 $self->lsdir($thispth, "^\Qlib$thislib.\E[0-9]+\Q\.$so"))) {
                 # Take care that libfoo.so.10 wins against libfoo.so.9.
                 # Compare two libraries to find the most recent version
                 # number.  E.g.  if you have libfoo.so.9.0.7 and
@@ -176,6 +186,8 @@ sub _unix_os2_ext {
                 #
                 # , the compilation tools expand the environment variables.)
             }
+            elsif ( $custom_name && -f ( $fullname = "$thispth/$thislib" ) ) {
+            }
             else {
                 warn "$thislib not found in $thispth\n" if $verbose;
                 next;
@@ -189,7 +201,7 @@ sub _unix_os2_ext {
 
             # what do we know about this library...
             my $is_dyna = ( $fullname !~ /\Q$Config_libext\E\z/ );
-            my $in_perl = ( $libs =~ /\B-l\Q${thislib}\E\b/s );
+            my $in_perl = ( $libs =~ /\B-l:?\Q${thislib}\E\b/s );
 
             # include the path to the lib once in the dynamic linker path
             # but only if it is a dynamic lib and not in Perl itself
@@ -209,7 +221,7 @@ sub _unix_os2_ext {
                     && ( $thislib eq 'm' || $thislib eq 'ndbm' ) )
               )
             {
-                push( @extralibs, "-l$thislib" );
+                push( @extralibs, "-l$custom_name$thislib" );
             }
 
             # We might be able to load this archive file dynamically
@@ -231,11 +243,11 @@ sub _unix_os2_ext {
 
                     # For SunOS4, do not add in this shared library if
                     # it is already linked in the main perl executable
-                    push( @ldloadlibs, "-l$thislib" )
+                    push( @ldloadlibs, "-l$custom_name$thislib" )
                       unless ( $in_perl and $^O eq 'sunos' );
                 }
                 else {
-                    push( @ldloadlibs, "-l$thislib" );
+                    push( @ldloadlibs, "-l$custom_name$thislib" );
                 }
             }
             last;    # found one here so don't bother looking further
@@ -330,8 +342,8 @@ sub _win32_ext {
     return ( '', '', '', '', ( $give_libs ? \@libs : () ) ) unless @extralibs;
 
     # make sure paths with spaces are properly quoted
-    @extralibs = map { /\s/ ? qq["$_"] : $_ } @extralibs;
-    @libs      = map { /\s/ ? qq["$_"] : $_ } @libs;
+    @extralibs = map { qq["$_"] } @extralibs;
+    @libs      = map { qq["$_"] } @libs;
 
     my $lib = join( ' ', @extralibs );
 
@@ -2,7 +2,7 @@ package ExtUtils::Liblist;
 
 use strict;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 use File::Spec;
 require ExtUtils::Liblist::Kid;
@@ -3,7 +3,7 @@ package ExtUtils::MM;
 use strict;
 use ExtUtils::MakeMaker::Config;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::Liblist;
 require ExtUtils::MakeMaker;
@@ -1,7 +1,7 @@
 package ExtUtils::MM_AIX;
 
 use strict;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
@@ -1,7 +1,7 @@
 package ExtUtils::MM_Any;
 
 use strict;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 use Carp;
 use File::Spec;
@@ -125,6 +125,142 @@ sub can_load_xs {
 }
 
 
+=head3 can_run
+
+  use ExtUtils::MM;
+  my $runnable = MM->can_run($Config{make});
+
+If called in a scalar context it will return the full path to the binary
+you asked for if it was found, or C<undef> if it was not.
+
+If called in a list context, it will return a list of the full paths to instances
+of the binary where found in C<PATH>, or an empty list if it was not found.
+
+Copied from L<IPC::Cmd|IPC::Cmd/"$path = can_run( PROGRAM );">, but modified into
+a method (and removed C<$INSTANCES> capability).
+
+=cut
+
+sub can_run {
+    my ($self, $command) = @_;
+
+    # a lot of VMS executables have a symbol defined
+    # check those first
+    if ( $^O eq 'VMS' ) {
+        require VMS::DCLsym;
+        my $syms = VMS::DCLsym->new;
+        return $command if scalar $syms->getsym( uc $command );
+    }
+
+    my @possibles;
+
+    if( File::Spec->file_name_is_absolute($command) ) {
+        return $self->maybe_command($command);
+
+    } else {
+        for my $dir (
+            File::Spec->path,
+            File::Spec->curdir
+        ) {
+            next if ! $dir || ! -d $dir;
+            my $abs = File::Spec->catfile($self->os_flavor_is('Win32') ? Win32::GetShortPathName( $dir ) : $dir, $command);
+            push @possibles, $abs if $abs = $self->maybe_command($abs);
+        }
+    }
+    return @possibles if wantarray;
+    return shift @possibles;
+}
+
+
+=head3 can_redirect_error
+
+  $useredirect = MM->can_redirect_error;
+
+True if on an OS where qx operator (or backticks) can redirect C<STDERR>
+onto C<STDOUT>.
+
+=cut
+
+sub can_redirect_error {
+  my $self = shift;
+  $self->os_flavor_is('Unix')
+      or ($self->os_flavor_is('Win32') and !$self->os_flavor_is('Win9x'))
+      or $self->os_flavor_is('OS/2')
+}
+
+
+=head3 is_make_type
+
+    my $is_dmake = $self->is_make_type('dmake');
+
+Returns true if C<<$self->make>> is the given type; possibilities are:
+
+  gmake    GNU make
+  dmake
+  nmake
+  bsdmake  BSD pmake-derived
+
+=cut
+
+sub is_make_type {
+    my($self, $type) = @_;
+    (undef, undef, my $make_basename) = $self->splitpath($self->make);
+    return 1 if $make_basename =~ /\b$type\b/; # executable's filename
+    # now have to run with "-v" and guess
+    my $redirect = $self->can_redirect_error ? '2>&1' : '';
+    my $make = $self->make || $self->{MAKE};
+    my $minus_v = `"$make" -v $redirect`;
+    return 1 if $type eq 'gmake' and $minus_v =~ /GNU make/i;
+    return 1 if $type eq 'bsdmake'
+      and $minus_v =~ /^usage: make \[-BeikNnqrstWwX\]/im;
+    0; # it wasn't whatever you asked
+}
+
+
+=head3 can_dep_space
+
+    my $can_dep_space = $self->can_dep_space;
+
+Returns true if C<make> can handle (probably by quoting)
+dependencies that contain a space. Currently known true for GNU make,
+false for BSD pmake derivative.
+
+=cut
+
+my $cached_dep_space;
+sub can_dep_space {
+    my $self = shift;
+    return $cached_dep_space if defined $cached_dep_space;
+    return $cached_dep_space = 1 if $self->is_make_type('gmake');
+    return $cached_dep_space = 0 if $self->is_make_type('dmake'); # only on W32
+    return $cached_dep_space = 0 if $self->is_make_type('bsdmake');
+    return $cached_dep_space = 0; # assume no
+}
+
+
+=head3 quote_dep
+
+  $text = $mm->quote_dep($text);
+
+Method that protects Makefile single-value constants (mainly filenames),
+so that make will still treat them as single values even if they
+inconveniently have spaces in. If the make program being used cannot
+achieve such protection and the given text would need it, throws an
+exception.
+
+=cut
+
+sub quote_dep {
+    my ($self, $arg) = @_;
+    die <<EOF if $arg =~ / / and not $self->can_dep_space;
+Tried to use make dependency with space for make that can't:
+  '$arg'
+EOF
+    $arg =~ s/( )/\\$1/g; # how GNU make does it
+    return $arg;
+}
+
+
 =head3 split_command
 
     my @cmds = $MM->split_command($cmd, @args);
@@ -781,9 +917,10 @@ END
     my @man_cmds;
     foreach my $section (qw(1 3)) {
         my $pods = $self->{"MAN${section}PODS"};
-        push @man_cmds, $self->split_command(<<CMD, map {($_,$pods->{$_})} sort keys %$pods);
-	\$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)
+        my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : "";
+	\$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s
 CMD
+        push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
     }
 
     $manify .= "\t\$(NOECHO) \$(NOOP)\n" unless @man_cmds;
@@ -1037,8 +1174,7 @@ sub _add_requirements_to_meta_v1_4 {
     # Check the original args so we can tell between the user setting it
     # to an empty hash and it just being initialized.
     if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
-        $meta{configure_requires}
-            = _normalize_prereqs($self->{CONFIGURE_REQUIRES});
+        $meta{configure_requires} = $self->{CONFIGURE_REQUIRES};
     } else {
         $meta{configure_requires} = {
             'ExtUtils::MakeMaker'       => 0,
@@ -1046,7 +1182,7 @@ sub _add_requirements_to_meta_v1_4 {
     }
 
     if( $self->{ARGS}{BUILD_REQUIRES} ) {
-        $meta{build_requires} = _normalize_prereqs($self->{BUILD_REQUIRES});
+        $meta{build_requires} = $self->{BUILD_REQUIRES};
     } else {
         $meta{build_requires} = {
             'ExtUtils::MakeMaker'       => 0,
@@ -1056,11 +1192,11 @@ sub _add_requirements_to_meta_v1_4 {
     if( $self->{ARGS}{TEST_REQUIRES} ) {
         $meta{build_requires} = {
           %{ $meta{build_requires} },
-          %{ _normalize_prereqs($self->{TEST_REQUIRES}) },
+          %{ $self->{TEST_REQUIRES} },
         };
     }
 
-    $meta{requires} = _normalize_prereqs($self->{PREREQ_PM})
+    $meta{requires} = $self->{PREREQ_PM}
         if defined $self->{PREREQ_PM};
     $meta{requires}{perl} = _normalize_version($self->{MIN_PERL_VERSION})
         if $self->{MIN_PERL_VERSION};
@@ -1074,8 +1210,7 @@ sub _add_requirements_to_meta_v2 {
     # Check the original args so we can tell between the user setting it
     # to an empty hash and it just being initialized.
     if( $self->{ARGS}{CONFIGURE_REQUIRES} ) {
-        $meta{prereqs}{configure}{requires}
-            = _normalize_prereqs($self->{CONFIGURE_REQUIRES});
+        $meta{prereqs}{configure}{requires} = $self->{CONFIGURE_REQUIRES};
     } else {
         $meta{prereqs}{configure}{requires} = {
             'ExtUtils::MakeMaker'       => 0,
@@ -1083,7 +1218,7 @@ sub _add_requirements_to_meta_v2 {
     }
 
     if( $self->{ARGS}{BUILD_REQUIRES} ) {
-        $meta{prereqs}{build}{requires} = _normalize_prereqs($self->{BUILD_REQUIRES});
+        $meta{prereqs}{build}{requires} = $self->{BUILD_REQUIRES};
     } else {
         $meta{prereqs}{build}{requires} = {
             'ExtUtils::MakeMaker'       => 0,
@@ -1091,10 +1226,10 @@ sub _add_requirements_to_meta_v2 {
     }
 
     if( $self->{ARGS}{TEST_REQUIRES} ) {
-        $meta{prereqs}{test}{requires} = _normalize_prereqs($self->{TEST_REQUIRES});
+        $meta{prereqs}{test}{requires} = $self->{TEST_REQUIRES};
     }
 
-    $meta{prereqs}{runtime}{requires} = _normalize_prereqs($self->{PREREQ_PM})
+    $meta{prereqs}{runtime}{requires} = $self->{PREREQ_PM}
         if $self->{ARGS}{PREREQ_PM};
     $meta{prereqs}{runtime}{requires}{perl} = _normalize_version($self->{MIN_PERL_VERSION})
         if $self->{MIN_PERL_VERSION};
@@ -1102,15 +1237,6 @@ sub _add_requirements_to_meta_v2 {
     return %meta;
 }
 
-sub _normalize_prereqs {
-  my ($hash) = @_;
-  my %prereqs;
-  while ( my ($k,$v) = each %$hash ) {
-    $prereqs{$k} = _normalize_version($v);
-  }
-  return \%prereqs;
-}
-
 # Adapted from Module::Build::Base
 sub _normalize_version {
   my ($version) = @_;
@@ -1993,7 +2119,7 @@ sub init_VERSION {
     if (defined $self->{VERSION}) {
         if ( $self->{VERSION} !~ /^\s*v?[\d_\.]+\s*$/ ) {
           require version;
-          my $normal = eval { version->parse( $self->{VERSION} ) };
+          my $normal = eval { version->new( $self->{VERSION} ) };
           $self->{VERSION} = $normal if defined $normal;
         }
         $self->{VERSION} =~ s/^\s+//;
@@ -2060,7 +2186,7 @@ Defines at least these macros.
 sub init_tools {
     my $self = shift;
 
-    $self->{ECHO}     ||= $self->oneliner('print qq{@ARGV}', ['-l']);
+    $self->{ECHO}     ||= $self->oneliner('binmode STDOUT, qq{:raw}; print qq{@ARGV}', ['-l']);
     $self->{ECHO_N}   ||= $self->oneliner('print qq{@ARGV}');
 
     $self->{TOUCH}    ||= $self->oneliner('touch', ["-MExtUtils::Command"]);
@@ -2722,7 +2848,7 @@ Used by perldepend() in MM_Unix and MM_VMS via _perl_header_files_fragment()
 sub _perl_header_files {
     my $self = shift;
 
-    my $header_dir = $self->{PERL_SRC} || $self->catdir($Config{archlibexp}, 'CORE');
+    my $header_dir = $self->{PERL_SRC} || $ENV{PERL_SRC} || $self->catdir($Config{archlibexp}, 'CORE');
     opendir my $dh, $header_dir
         or die "Failed to opendir '$header_dir' to find header files: $!";
 
@@ -2759,7 +2885,7 @@ sub _perl_header_files_fragment {
     return join("\\\n",
                 "PERL_HDRS = ",
                 map {
-                    sprintf( "        \$(PERL_INC)%s%s            ", $separator, $_ )
+                    sprintf( "        \$(PERL_INCDEP)%s%s            ", $separator, $_ )
                 } $self->_perl_header_files()
            ) . "\n\n"
            . "\$(OBJECT) : \$(PERL_HDRS)\n";
@@ -26,7 +26,7 @@ require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
 
 our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 
 =item os_flavor
@@ -50,6 +50,7 @@ sub init_linker {
 
     $self->{PERL_ARCHIVE} ||=
       File::Spec->catdir('$(PERL_INC)',$Config{libperl});
+    $self->{PERL_ARCHIVEDEP} ||= '';
     $self->{PERL_ARCHIVE_AFTER} ||= '';
     $self->{EXPORT_LIST}  ||= '';
 }
@@ -9,7 +9,7 @@ require ExtUtils::MM_Unix;
 require ExtUtils::MM_Win32;
 our @ISA = qw( ExtUtils::MM_Unix );
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 
 =head1 NAME
@@ -94,6 +94,7 @@ sub init_linker {
           '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a");
     }
 
+    $self->{PERL_ARCHIVEDEP} ||= '';
     $self->{PERL_ARCHIVE_AFTER} ||= '';
     $self->{EXPORT_LIST}  ||= '';
 }
@@ -2,7 +2,7 @@ package ExtUtils::MM_DOS;
 
 use strict;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
@@ -7,7 +7,7 @@ BEGIN {
     our @ISA = qw( ExtUtils::MM_Unix );
 }
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 
 =head1 NAME
@@ -2,7 +2,7 @@ package ExtUtils::MM_MacOS;
 
 use strict;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 sub new {
     die <<'UNSUPPORTED';
@@ -22,7 +22,7 @@ use strict;
 use ExtUtils::MakeMaker::Config;
 use File::Basename;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Win32;
 our @ISA = qw(ExtUtils::MM_Win32);
@@ -5,7 +5,7 @@ use strict;
 use ExtUtils::MakeMaker qw(neatvalue);
 use File::Spec;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
@@ -129,6 +129,7 @@ sub init_linker {
 
     $self->{PERL_ARCHIVE} = "\$(PERL_INC)/libperl\$(LIB_EXT)";
 
+    $self->{PERL_ARCHIVEDEP} ||= '';
     $self->{PERL_ARCHIVE_AFTER} = $OS2::is_aout
       ? ''
       : '$(PERL_INC)/libperl_override$(LIB_EXT)';
@@ -1,7 +1,7 @@
 package ExtUtils::MM_QNX;
 
 use strict;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
@@ -1,7 +1,7 @@
 package ExtUtils::MM_UWIN;
 
 use strict;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
@@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue);
 
 # If we make $VERSION an our variable parse_version() breaks
 use vars qw($VERSION);
-$VERSION = '6.98';
+$VERSION = '7.02';
 $VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
 
 require ExtUtils::MM_Any;
@@ -190,6 +190,19 @@ sub cflags {
 
     @cflags{qw(cc ccflags optimize shellflags)}
 	= @Config{qw(cc ccflags optimize shellflags)};
+
+    # Perl 5.21.4 adds the (gcc) warning (-Wall ...) and std (-std=c89)
+    # flags to the %Config, and the modules in the core can be built
+    # with those.
+    my @ccextraflags = qw(ccwarnflags ccstdflags);
+    if ($ENV{PERL_CORE}) {
+      for my $x (@ccextraflags) {
+        if (exists $Config{$x}) {
+          $cflags{$x} = $Config{$x};
+        }
+      }
+    }
+
     my($optdebug) = "";
 
     $cflags{shellflags} ||= '';
@@ -258,6 +271,10 @@ sub cflags {
 	$self->{CCFLAGS} .= ' -DPERL_POLLUTE ';
     }
 
+    for my $x (@ccextraflags) {
+      $self->{CCFLAGS} .= $cflags{$x} if exists $cflags{$x};
+    }
+
     my $pollute = '';
     if ($Config{usemymalloc} and not $Config{bincompat5005}
 	and not $Config{ccflags} =~ /-DPERL_POLLUTE_MALLOC\b/
@@ -387,10 +404,10 @@ sub constants {
                         } $self->installvars),
                    qw(
               PERL_LIB
-              PERL_ARCHLIB
+              PERL_ARCHLIB PERL_ARCHLIBDEP
               LIBPERL_A MYEXTLIB
               FIRST_MAKEFILE MAKEFILE_OLD MAKE_APERL_FILE
-              PERLMAINCC PERL_SRC PERL_INC
+              PERLMAINCC PERL_SRC PERL_INC PERL_INCDEP
               PERL            FULLPERL          ABSPERL
               PERLRUN         FULLPERLRUN       ABSPERLRUN
               PERLRUNINST     FULLPERLRUNINST   ABSPERLRUNINST
@@ -404,6 +421,8 @@ sub constants {
         # pathnames can have sharp signs in them; escape them so
         # make doesn't think it is a comment-start character.
         $self->{$macro} =~ s/#/\\#/g;
+	$self->{$macro} = $self->quote_dep($self->{$macro})
+	  if $ExtUtils::MakeMaker::macro_dep{$macro};
 	push @m, "$macro = $self->{$macro}\n";
     }
 
@@ -443,7 +462,7 @@ MAN3PODS = ".$self->wraplist(sort keys %{$self->{MAN3PODS}})."
 
     push @m, q{
 # Where is the Config information that we are using/depend on
-CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
+CONFIGDEP = $(PERL_ARCHLIBDEP)$(DFSEP)Config.pm $(PERL_INCDEP)$(DFSEP)config.h
 } if -e File::Spec->catfile( $self->{PERL_INC}, 'config.h' );
 
 
@@ -460,11 +479,11 @@ INST_DYNAMIC     = $self->{INST_DYNAMIC}
 INST_BOOT        = $self->{INST_BOOT}
 };
 
-
     push @m, qq{
 # Extra linker info
 EXPORT_LIST        = $self->{EXPORT_LIST}
 PERL_ARCHIVE       = $self->{PERL_ARCHIVE}
+PERL_ARCHIVEDEP    = $self->{PERL_ARCHIVEDEP}
 PERL_ARCHIVE_AFTER = $self->{PERL_ARCHIVE_AFTER}
 };
 
@@ -878,8 +897,8 @@ $(BOOTSTRAP) : $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DFSEP).exists
 	$(NOECHO) $(PERLRUN) \
 		"-MExtUtils::Mkbootstrap" \
 		-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
-	$(NOECHO) $(TOUCH) %s
-	$(CHMOD) $(PERM_RW) %s
+	$(NOECHO) $(TOUCH) "%s"
+	$(CHMOD) $(PERM_RW) "%s"
 MAKE_FRAG
 }
 
@@ -911,7 +930,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
 INST_DYNAMIC_FIX = '.$ld_fix.'
 
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
 ');
     if ($armaybe ne ':'){
 	$ldfrom = 'tmp$(LIB_EXT)';
@@ -940,13 +959,13 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPO
 	# platforms.  We peek at lddlflags to see if we need -Wl,-R
 	# or -R to add paths to the run-time library search path.
         if ($Config{'lddlflags'} =~ /-Wl,-R/) {
-            $libs .= ' -L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -Wl,-R$(PERL_ARCHLIB)/CORE -lperl';
+            $libs .= ' "-L$(PERL_INC)" "-Wl,-R$(INSTALLARCHLIB)/CORE" "-Wl,-R$(PERL_ARCHLIB)/CORE" -lperl';
         } elsif ($Config{'lddlflags'} =~ /-R/) {
-            $libs .= ' -L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -R$(PERL_ARCHLIB)/CORE -lperl';
+            $libs .= ' "-L$(PERL_INC)" "-R$(INSTALLARCHLIB)/CORE" "-R$(PERL_ARCHLIB)/CORE" -lperl';
         } elsif ( $Is{Android} ) {
             # The Android linker will not recognize symbols from
             # libperl unless the module explicitly depends on it.
-            $libs .= ' -L$(PERL_INC) -lperl';
+            $libs .= ' "-L$(PERL_INC)" -lperl';
         }
     }
 
@@ -1043,7 +1062,7 @@ WARNING
             next unless $self->maybe_command($abs);
             print "Executing $abs\n" if ($trace >= 2);
 
-            my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};
+            my $version_check = qq{"$abs" -le "require $ver; print qq{VER_OK}"};
 
             # To avoid using the unportable 2>&1 to suppress STDERR,
             # we close it before running the command.
@@ -1191,10 +1210,6 @@ sub _fixin_replace_shebang {
             $shb .= ' ' . $arg if defined $arg;
             $shb .= "\n";
         }
-        $shb .= qq{
-eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
-    if 0; # not running under some shell
-} unless $Is{Win32};    # this won't work on win32, so don't
     }
     else {
         warn "Can't find $cmd in PATH, $file unchanged"
@@ -1712,6 +1727,8 @@ EOP
     	$self->{PERL_LIB} = File::Spec->rel2abs($self->{PERL_LIB});
     	$self->{PERL_ARCHLIB} = File::Spec->rel2abs($self->{PERL_ARCHLIB});
     }
+    $self->{PERL_INCDEP} = $self->{PERL_INC};
+    $self->{PERL_ARCHLIBDEP} = $self->{PERL_ARCHLIB};
 
     # We get SITELIBEXP and SITEARCHEXP directly via
     # Get_from_Config. When we are running standard modules, these
@@ -1805,6 +1822,7 @@ Unix has no need of special linker flags.
 sub init_linker {
     my($self) = shift;
     $self->{PERL_ARCHIVE} ||= '';
+    $self->{PERL_ARCHIVEDEP} ||= '';
     $self->{PERL_ARCHIVE_AFTER} ||= '';
     $self->{EXPORT_LIST}  ||= '';
 }
@@ -1909,8 +1927,20 @@ sub init_PERL {
 
     $self->{PERL} ||=
         $self->find_perl(5.0, \@perls, \@defpath, $Verbose );
-    # don't check if perl is executable, maybe they have decided to
-    # supply switches with perl
+
+    my $perl = $self->{PERL};
+    $perl =~ s/^"//;
+    my $has_mcr = $perl =~ s/^MCR\s*//;
+    my $perlflags = '';
+    my $stripped_perl;
+    while ($perl) {
+	($stripped_perl = $perl) =~ s/"$//;
+	last if -x $stripped_perl;
+	last unless $perl =~ s/(\s+\S+)$//;
+	$perlflags = $1.$perlflags;
+    }
+    $self->{PERL} = $stripped_perl;
+    $self->{PERL} = 'MCR '.$self->{PERL} if $has_mcr || $Is{VMS};
 
     # When built for debugging, VMS doesn't create perl.exe but ndbgperl.exe.
     my $perl_name = 'perl';
@@ -1920,13 +1950,18 @@ sub init_PERL {
     # XXX This logic is flawed.  If "miniperl" is anywhere in the path
     # it will get confused.  It should be fixed to work only on the filename.
     # Define 'FULLPERL' to be a non-miniperl (used in test: target)
-    ($self->{FULLPERL} = $self->{PERL}) =~ s/\Q$miniperl\E$/$perl_name$Config{exe_ext}/i
-	unless $self->{FULLPERL};
+    unless ($self->{FULLPERL}) {
+      ($self->{FULLPERL} = $self->{PERL}) =~ s/\Q$miniperl\E$/$perl_name$Config{exe_ext}/i;
+      $self->{FULLPERL} = qq{"$self->{FULLPERL}"}.$perlflags;
+    }
+    # Can't have an image name with quotes, and findperl will have
+    # already escaped spaces.
+    $self->{FULLPERL} =~ tr/"//d if $Is{VMS};
 
     # Little hack to get around VMS's find_perl putting "MCR" in front
     # sometimes.
     $self->{ABSPERL} = $self->{PERL};
-    my $has_mcr = $self->{ABSPERL} =~ s/^MCR\s*//;
+    $has_mcr = $self->{ABSPERL} =~ s/^MCR\s*//;
     if( $self->file_name_is_absolute($self->{ABSPERL}) ) {
         $self->{ABSPERL} = '$(PERL)';
     }
@@ -1939,6 +1974,11 @@ sub init_PERL {
 
         $self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr;
     }
+    $self->{PERL} = qq{"$self->{PERL}"}.$perlflags;
+
+    # Can't have an image name with quotes, and findperl will have
+    # already escaped spaces.
+    $self->{PERL} =~ tr/"//d if $Is{VMS};
 
     # Are we building the core?
     $self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE};
@@ -1948,14 +1988,15 @@ sub init_PERL {
     foreach my $perl (qw(PERL FULLPERL ABSPERL)) {
         my $run  = $perl.'RUN';
 
-        $self->{$run}  = "\$($perl)";
+        $self->{$run}  = qq{\$($perl)};
 
         # Make sure perl can find itself before it's installed.
         $self->{$run} .= q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"}
           if $self->{UNINSTALLED_PERL} || $self->{PERL_CORE};
 
         $self->{$perl.'RUNINST'} =
-          sprintf q{$(%sRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"}, $perl;
+          sprintf q{$(%sRUN)%s "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"},
+	    $perl, $perlflags;
     }
 
     return 1;
@@ -2079,54 +2120,54 @@ pure_perl_install :: all
 };
 
     push @m,
-q{		read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
-		write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
+q{		read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+		write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
 } unless $self->{NO_PACKLIST};
 
     push @m,
-q{		$(INST_LIB) $(DESTINSTALLPRIVLIB) \
-		$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
-		$(INST_BIN) $(DESTINSTALLBIN) \
-		$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
-		$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
-		$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
+q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+		"$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+		"$(INST_BIN)" "$(DESTINSTALLBIN)" \
+		"$(INST_SCRIPT)" "$(DESTINSTALLSCRIPT)" \
+		"$(INST_MAN1DIR)" "$(DESTINSTALLMAN1DIR)" \
+		"$(INST_MAN3DIR)" "$(DESTINSTALLMAN3DIR)"
 	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
-		}.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
+		"}.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{"
 
 
 pure_site_install :: all
 	$(NOECHO) $(MOD_INSTALL) \
 };
     push @m,
-q{		read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
-		write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
+q{		read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+		write "}.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{" \
 } unless $self->{NO_PACKLIST};
 
     push @m,
-q{		$(INST_LIB) $(DESTINSTALLSITELIB) \
-		$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
-		$(INST_BIN) $(DESTINSTALLSITEBIN) \
-		$(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \
-		$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
-		$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
+q{		"$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+		"$(INST_ARCHLIB)" "$(DESTINSTALLSITEARCH)" \
+		"$(INST_BIN)" "$(DESTINSTALLSITEBIN)" \
+		"$(INST_SCRIPT)" "$(DESTINSTALLSITESCRIPT)" \
+		"$(INST_MAN1DIR)" "$(DESTINSTALLSITEMAN1DIR)" \
+		"$(INST_MAN3DIR)" "$(DESTINSTALLSITEMAN3DIR)"
 	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
-		}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
+		"}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{"
 
 pure_vendor_install :: all
 	$(NOECHO) $(MOD_INSTALL) \
 };
     push @m,
-q{		read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
-		write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \
+q{		read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+		write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
 } unless $self->{NO_PACKLIST};
 
     push @m,
-q{		$(INST_LIB) $(DESTINSTALLVENDORLIB) \
-		$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
-		$(INST_BIN) $(DESTINSTALLVENDORBIN) \
-		$(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \
-		$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
-		$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
+q{		"$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+		"$(INST_ARCHLIB)" "$(DESTINSTALLVENDORARCH)" \
+		"$(INST_BIN)" "$(DESTINSTALLVENDORBIN)" \
+		"$(INST_SCRIPT)" "$(DESTINSTALLVENDORSCRIPT)" \
+		"$(INST_MAN1DIR)" "$(DESTINSTALLVENDORMAN1DIR)" \
+		"$(INST_MAN3DIR)" "$(DESTINSTALLVENDORMAN3DIR)"
 
 };
 
@@ -2144,37 +2185,37 @@ doc_vendor_install :: all
 
     push @m, q{
 doc_perl_install :: all
-	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
 	-$(NOECHO) $(DOC_INSTALL) \
 		"Module" "$(NAME)" \
-		"installed into" "$(INSTALLPRIVLIB)" \
+		"installed into" $(INSTALLPRIVLIB) \
 		LINKTYPE "$(LINKTYPE)" \
 		VERSION "$(VERSION)" \
 		EXE_FILES "$(EXE_FILES)" \
-		>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
+		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
 
 doc_site_install :: all
-	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
 	-$(NOECHO) $(DOC_INSTALL) \
 		"Module" "$(NAME)" \
-		"installed into" "$(INSTALLSITELIB)" \
+		"installed into" $(INSTALLSITELIB) \
 		LINKTYPE "$(LINKTYPE)" \
 		VERSION "$(VERSION)" \
 		EXE_FILES "$(EXE_FILES)" \
-		>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
+		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
 
 doc_vendor_install :: all
-	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
 	-$(NOECHO) $(DOC_INSTALL) \
 		"Module" "$(NAME)" \
-		"installed into" "$(INSTALLVENDORLIB)" \
+		"installed into" $(INSTALLVENDORLIB) \
 		LINKTYPE "$(LINKTYPE)" \
 		VERSION "$(VERSION)" \
 		EXE_FILES "$(EXE_FILES)" \
-		>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
+		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
 
 } unless $self->{NO_PERLLOCAL};
 
@@ -2183,13 +2224,13 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
 	$(NOECHO) $(NOOP)
 
 uninstall_from_perldirs ::
-	$(NOECHO) $(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
+	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
 
 uninstall_from_sitedirs ::
-	$(NOECHO) $(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
+	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
 
 uninstall_from_vendordirs ::
-	$(NOECHO) $(UNINSTALL) }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{
+	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
 };
 
     join("",@m);
@@ -2343,7 +2384,7 @@ $(MAP_TARGET) :: static $(MAKE_APERL_FILE)
 $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
 	$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
 	$(NOECHO) $(PERLRUNINST) \
-		Makefile.PL DIR=}, $dir, q{ \
+		Makefile.PL DIR="}, $dir, q{" \
 		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
 		MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
 
@@ -2521,20 +2562,20 @@ $tmp/perlmain.c: $makefilename}, q{
 		-e "writemain(grep s#.*/auto/##s, split(q| |, q|$(MAP_STATIC)|))" > $@t && $(MV) $@t $@
 
 };
-    push @m, "\t", q{$(NOECHO) $(PERL) $(INSTALLSCRIPT)/fixpmain
+    push @m, "\t", q{$(NOECHO) $(PERL) "$(INSTALLSCRIPT)/fixpmain"
 } if (defined (&Dos::UseLFN) && Dos::UseLFN()==0);
 
 
     push @m, q{
 doc_inst_perl :
-	$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
+	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
 	-$(NOECHO) $(DOC_INSTALL) \
 		"Perl binary" "$(MAP_TARGET)" \
 		MAP_STATIC "$(MAP_STATIC)" \
 		MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
 		MAP_LIBPERL "$(MAP_LIBPERL)" \
-		>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
+		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
 
 };
 
@@ -2542,7 +2583,7 @@ doc_inst_perl :
 inst_perl : pure_inst_perl doc_inst_perl
 
 pure_inst_perl : $(MAP_TARGET)
-	}.$self->{CP}.q{ $(MAP_TARGET) }.$self->catfile('$(DESTINSTALLBIN)','$(MAP_TARGET)').q{
+	}.$self->{CP}.q{ $(MAP_TARGET) "}.$self->catfile('$(DESTINSTALLBIN)','$(MAP_TARGET)').q{"
 
 clean :: map_clean
 
@@ -2651,17 +2692,24 @@ sub parse_abstract {
     local $/ = "\n";
     open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!";
     my $inpod = 0;
+    my $pod_encoding;
     my $package = $self->{DISTNAME};
     $package =~ s/-/::/g;
     while (<$fh>) {
         $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
         next if !$inpod;
         chop;
+
+        if ( /^=encoding\s*(.*)$/i ) {
+            $pod_encoding = $1;
+        }
+
         if ( /^($package(?:\.pm)? \s+ -+ \s+)(.*)/x ) {
           $result = $2;
           next;
         }
         next unless $result;
+
         if ( $result && ( /^\s*$/ || /^\=/ ) ) {
           last;
         }
@@ -2669,6 +2717,11 @@ sub parse_abstract {
     }
     close $fh;
 
+    if ( $pod_encoding and !( $] < 5.008 or !$Config{useperlio} ) ) {
+        require Encode;
+        $result = Encode::decode($pod_encoding, $result);
+    }
+
     return $result;
 }
 
@@ -2721,43 +2774,32 @@ sub parse_version {
 
     if ( defined $result && $result !~ /^v?[\d_\.]+$/ ) {
       require version;
-      my $normal = eval { version->parse( $result ) };
+      my $normal = eval { version->new( $result ) };
       $result = $normal if defined $normal;
     }
     $result = "undef" unless defined $result;
     return $result;
 }
 
-sub get_version
-{
-	my ($self, $parsefile, $sigil, $name) = @_;
-	my $eval = qq{
-		package ExtUtils::MakeMaker::_version;
-		no strict;
-		BEGIN { eval {
-			# Ensure any version() routine which might have leaked
-			# into this package has been deleted.  Interferes with
-			# version->import()
-			undef *version;
-			require version;
-			"version"->import;
-		} }
-
-		local $sigil$name;
-		\$$name=undef;
-		do {
-			$_
-		};
-		\$$name;
-	};
-  $eval = $1 if $eval =~ m{^(.+)}s;
-	local $^W = 0;
-	my $result = eval($eval);  ## no critic
-	warn "Could not eval '$eval' in $parsefile: $@" if $@;
-	$result;
+sub get_version {
+    my ($self, $parsefile, $sigil, $name) = @_;
+    my $line = $_; # from the while() loop in parse_version
+    {
+        package ExtUtils::MakeMaker::_version;
+        undef *version; # in case of unexpected version() sub
+        eval {
+            require version;
+            version::->import;
+        };
+        no strict;
+        local *{$name};
+        local $^W = 0;
+        $line = $1 if $line =~ m{^(.+)}s;
+        eval($line); ## no critic
+        return ${$name};
+    }
 }
 
-
 =item pasthru (o)
 
 Defines the string that is passed to recursive make calls in
@@ -2821,7 +2863,7 @@ sub perldepend {
 # Check for unpropogated config.sh changes. Should never happen.
 # We do NOT just update config.h because that is not sufficient.
 # An out of date config.h is not fatal but complains loudly!
-$(PERL_INC)/config.h: $(PERL_SRC)/config.sh
+$(PERL_INCDEP)/config.h: $(PERL_SRC)/config.sh
 	-$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; $(FALSE)
 
 $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
@@ -2837,7 +2879,7 @@ MAKE_FRAG
         push @m, $self->_perl_header_files_fragment("/"); # Directory separator between $(PERL_INC)/header.h
     }
 
-    push @m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n"  if %{$self->{XS}};
+    push @m, join(" ", sort values %{$self->{XS}})." : \$(XSUBPPDEPS)\n"  if %{$self->{XS}};
 
     return join "\n", @m;
 }
@@ -2960,11 +3002,11 @@ PPD_PERLVERS
     foreach my $prereq (sort keys %prereqs) {
         my $name = $prereq;
         $name .= '::' unless $name =~ /::/;
-        my $version = $prereqs{$prereq}+0;  # force numification
+        my $version = $prereqs{$prereq};
 
         my %attrs = ( NAME => $name );
         $attrs{VERSION} = $version if $version;
-        my $attrs = join " ", map { qq[$_="$attrs{$_}"] } keys %attrs;
+        my $attrs = join " ", map { qq[$_="$attrs{$_}"] } sort keys %attrs;
         $ppd_xml .= qq(        <REQUIRE $attrs />\n);
     }
 
@@ -3198,6 +3240,17 @@ sub oneliner {
 
 =item quote_literal
 
+Quotes macro literal value suitable for being used on a command line so
+that when expanded by make, will be received by command as given to
+this method:
+
+  my $quoted = $mm->quote_literal(q{it isn't});
+  # returns:
+  #   'it isn'\''t'
+  print MAKEFILE "target:\n\techo $quoted\n";
+  # when run "make target", will output:
+  #   it isn't
+
 =cut
 
 sub quote_literal {
@@ -3287,7 +3340,7 @@ END
     # If this extension has its own library (eg SDBM_File)
     # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
     push(@m, <<'MAKE_FRAG') if $self->{MYEXTLIB};
-	$(CP) $(MYEXTLIB) $@
+	$(CP) $(MYEXTLIB) "$@"
 MAKE_FRAG
 
     my $ar;
@@ -3301,12 +3354,12 @@ MAKE_FRAG
     push @m, sprintf <<'MAKE_FRAG', $ar;
 	$(%s) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
 	$(CHMOD) $(PERM_RWX) $@
-	$(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
+	$(NOECHO) $(ECHO) "$(EXTRALIBS)" > "$(INST_ARCHAUTODIR)/extralibs.ld"
 MAKE_FRAG
 
     # Old mechanism - still available:
     push @m, <<'MAKE_FRAG' if $self->{PERL_SRC} && $self->{EXTRALIBS};
-	$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs
+	$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> "$(PERL_SRC)/ext.libs"
 MAKE_FRAG
 
     join('', @m);
@@ -3420,6 +3473,8 @@ sub test {
     elsif (!$tests && -d 't') {
         $tests = $self->find_tests;
     }
+    # have to do this because nmake is broken
+    $tests =~ s!/!\\!g if $self->is_make_type('nmake');
     # note: 'test.pl' name is also hardcoded in init_dirscan()
     my(@m);
     push(@m,"
@@ -3545,7 +3600,8 @@ sub tool_xsubpp {
         }
     }
     push(@tmdeps, "typemap") if -f "typemap";
-    my(@tmargs) = map("-typemap $_", @tmdeps);
+    my @tmargs = map(qq{-typemap "$_"}, @tmdeps);
+    $_ = $self->quote_dep($_) for @tmdeps;
     if( exists $self->{XSOPT} ){
         unshift( @tmargs, $self->{XSOPT} );
     }
@@ -3561,17 +3617,19 @@ sub tool_xsubpp {
 
 
     $self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
+    my $xsdirdep = $self->quote_dep($xsdir);
+    # -dep for use when dependency not command
 
     return qq{
 XSUBPPDIR = $xsdir
-XSUBPP = \$(XSUBPPDIR)\$(DFSEP)xsubpp
+XSUBPP = "\$(XSUBPPDIR)\$(DFSEP)xsubpp"
 XSUBPPRUN = \$(PERLRUN) \$(XSUBPP)
 XSPROTOARG = $self->{XSPROTOARG}
-XSUBPPDEPS = @tmdeps \$(XSUBPP)
+XSUBPPDEPS = @tmdeps $xsdirdep\$(DFSEP)xsubpp
 XSUBPPARGS = @tmargs
 XSUBPP_EXTRA_ARGS =
 };
-};
+}
 
 
 =item all_target
@@ -15,7 +15,7 @@ BEGIN {
 
 use File::Basename;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
@@ -1893,6 +1893,7 @@ sub init_linker {
           $ENV{$shr} ? $ENV{$shr} : "Sys\$Share:$shr.$Config{'dlext'}";
     }
 
+    $self->{PERL_ARCHIVEDEP} ||= '';
     $self->{PERL_ARCHIVE_AFTER} ||= '';
 }
 
@@ -1,7 +1,7 @@
 package ExtUtils::MM_VOS;
 
 use strict;
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Unix;
 our @ISA = qw(ExtUtils::MM_Unix);
@@ -27,7 +27,7 @@ use ExtUtils::MakeMaker qw( neatvalue );
 require ExtUtils::MM_Any;
 require ExtUtils::MM_Unix;
 our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 $ENV{EMXSHELL} = 'sh'; # to run `commands`
 
@@ -128,7 +128,7 @@ sub maybe_command {
 
 =item B<init_DIRFILESEP>
 
-Using \ for Windows.
+Using \ for Windows, except for "gmake" where it is /.
 
 =cut
 
@@ -137,7 +137,8 @@ sub init_DIRFILESEP {
 
     # The ^ makes sure its not interpreted as an escape in nmake
     $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' :
-                          $self->is_make_type('dmake') ? '\\\\'
+                          $self->is_make_type('dmake') ? '\\\\' :
+                          $self->is_make_type('gmake') ? '/'
                                                        : '\\';
 }
 
@@ -154,7 +155,7 @@ sub init_tools {
     $self->{DEV_NULL} ||= '> NUL';
 
     $self->{FIXIN}    ||= $self->{PERL_CORE} ?
-      "\$(PERLRUN) $self->{PERL_SRC}/win32/bin/pl2bat.pl" :
+      "\$(PERLRUN) $self->{PERL_SRC}\\win32\\bin\\pl2bat.pl" :
       'pl2bat.bat';
 
     $self->SUPER::init_tools;
@@ -346,27 +347,27 @@ sub dynamic_lib {
 OTHERLDFLAGS = '.$otherldflags.'
 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
 
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(INST_DYNAMIC_DEP)
 ');
     if ($GCC) {
       push(@m,
        q{	}.$DLLTOOL.q{ --def $(EXPORT_LIST) --output-exp dll.exp
-	$(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
+	$(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) "$(PERL_ARCHIVE)" $(LDLOADLIBS) dll.exp
 	}.$DLLTOOL.q{ --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
-	$(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
+	$(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) "$(PERL_ARCHIVE)" $(LDLOADLIBS) dll.exp });
     } elsif ($BORLAND) {
       push(@m,
        q{	$(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
        .($self->is_make_type('dmake')
-                ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
+                ? q{"$(PERL_ARCHIVE:s,/,\,)" $(LDLOADLIBS:s,/,\,) }
 		 .q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
-		: q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
+		: q{"$(subst /,\,$(PERL_ARCHIVE))" $(subst /,\,$(LDLOADLIBS)) }
 		 .q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
        .q{,$(RESFILES)});
     } else {	# VC
       push(@m,
        q{	$(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
-      .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
+      .q{$(MYEXTLIB) "$(PERL_ARCHIVE)" $(LDLOADLIBS) -def:$(EXPORT_LIST)});
 
       # Embed the manifest file if it exists
       push(@m, q{
@@ -401,6 +402,7 @@ sub init_linker {
     my $self = shift;
 
     $self->{PERL_ARCHIVE}       = "\$(PERL_INC)\\$Config{libperl}";
+    $self->{PERL_ARCHIVEDEP}    = "\$(PERL_INCDEP)\\$Config{libperl}";
     $self->{PERL_ARCHIVE_AFTER} = '';
     $self->{EXPORT_LIST}        = '$(BASEEXT).def';
 }
@@ -421,6 +423,29 @@ sub perl_script {
     return;
 }
 
+sub can_dep_space {
+    my $self = shift;
+    1; # with Win32::GetShortPathName
+}
+
+=item quote_dep
+
+=cut
+
+sub quote_dep {
+    my ($self, $arg) = @_;
+    if ($arg =~ / / and not $self->is_make_type('gmake')) {
+        require Win32;
+        $arg = Win32::GetShortPathName($arg);
+        die <<EOF if not defined $arg or $arg =~ / /;
+Tried to use make dependency with space for non-GNU make:
+  '$arg'
+Fallback to short pathname failed.
+EOF
+        return $arg;
+    }
+    return $self->SUPER::quote_dep($arg);
+}
 
 =item xs_o
 
@@ -622,16 +647,7 @@ PERLTYPE = $self->{PERLTYPE}
 
 }
 
-sub is_make_type {
-    my($self, $type) = @_;
-    return !! ($self->make =~ /\b$type(?:\.exe)?$/);
-}
-
 1;
 __END__
 
 =back
-
-=cut
-
-
@@ -2,7 +2,7 @@ package ExtUtils::MM_Win95;
 
 use strict;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require ExtUtils::MM_Win32;
 our @ISA = qw(ExtUtils::MM_Win32);
@@ -3,7 +3,7 @@ package ExtUtils::MY;
 use strict;
 require ExtUtils::MM;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 our @ISA = qw(ExtUtils::MM);
 
 {
@@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::Config;
 
 use strict;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 use Config ();
 
@@ -1,6 +1,6 @@
 package ExtUtils::MakeMaker::FAQ;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 1;
 __END__
@@ -0,0 +1,348 @@
+package ExtUtils::MakeMaker::Locale;
+
+use strict;
+our $VERSION = "7.02";
+
+use base 'Exporter';
+our @EXPORT_OK = qw(
+    decode_argv env
+    $ENCODING_LOCALE $ENCODING_LOCALE_FS
+    $ENCODING_CONSOLE_IN $ENCODING_CONSOLE_OUT
+);
+
+use Encode ();
+use Encode::Alias ();
+
+our $ENCODING_LOCALE;
+our $ENCODING_LOCALE_FS;
+our $ENCODING_CONSOLE_IN;
+our $ENCODING_CONSOLE_OUT;
+
+sub DEBUG () { 0 }
+
+sub _init {
+    if ($^O eq "MSWin32") {
+	unless ($ENCODING_LOCALE) {
+	    # Try to obtain what the Windows ANSI code page is
+	    eval {
+		unless (defined &GetACP) {
+		    require Win32::API;
+		    Win32::API->Import('kernel32', 'int GetACP()');
+		};
+		if (defined &GetACP) {
+		    my $cp = GetACP();
+		    $ENCODING_LOCALE = "cp$cp" if $cp;
+		}
+	    };
+	}
+
+	unless ($ENCODING_CONSOLE_IN) {
+	    # If we have the Win32::Console module installed we can ask
+	    # it for the code set to use
+	    eval {
+		require Win32::Console;
+		my $cp = Win32::Console::InputCP();
+		$ENCODING_CONSOLE_IN = "cp$cp" if $cp;
+		$cp = Win32::Console::OutputCP();
+		$ENCODING_CONSOLE_OUT = "cp$cp" if $cp;
+	    };
+	    # Invoking the 'chcp' program might also work
+	    if (!$ENCODING_CONSOLE_IN && (qx(chcp) || '') =~ /^Active code page: (\d+)/) {
+		$ENCODING_CONSOLE_IN = "cp$1";
+	    }
+	}
+    }
+
+    unless ($ENCODING_LOCALE) {
+	eval {
+	    require I18N::Langinfo;
+	    $ENCODING_LOCALE = I18N::Langinfo::langinfo(I18N::Langinfo::CODESET());
+
+	    # Workaround of Encode < v2.25.  The "646" encoding  alias was
+	    # introduced in Encode-2.25, but we don't want to require that version
+	    # quite yet.  Should avoid the CPAN testers failure reported from
+	    # openbsd-4.7/perl-5.10.0 combo.
+	    $ENCODING_LOCALE = "ascii" if $ENCODING_LOCALE eq "646";
+
+	    # https://rt.cpan.org/Ticket/Display.html?id=66373
+	    $ENCODING_LOCALE = "hp-roman8" if $^O eq "hpux" && $ENCODING_LOCALE eq "roman8";
+	};
+	$ENCODING_LOCALE ||= $ENCODING_CONSOLE_IN;
+    }
+
+    if ($^O eq "darwin") {
+	$ENCODING_LOCALE_FS ||= "UTF-8";
+    }
+
+    # final fallback
+    $ENCODING_LOCALE ||= $^O eq "MSWin32" ? "cp1252" : "UTF-8";
+    $ENCODING_LOCALE_FS ||= $ENCODING_LOCALE;
+    $ENCODING_CONSOLE_IN ||= $ENCODING_LOCALE;
+    $ENCODING_CONSOLE_OUT ||= $ENCODING_CONSOLE_IN;
+
+    unless (Encode::find_encoding($ENCODING_LOCALE)) {
+	my $foundit;
+	if (lc($ENCODING_LOCALE) eq "gb18030") {
+	    eval {
+		require Encode::HanExtra;
+	    };
+	    if ($@) {
+		die "Need Encode::HanExtra to be installed to support locale codeset ($ENCODING_LOCALE), stopped";
+	    }
+	    $foundit++ if Encode::find_encoding($ENCODING_LOCALE);
+	}
+	die "The locale codeset ($ENCODING_LOCALE) isn't one that perl can decode, stopped"
+	    unless $foundit;
+
+    }
+
+    # use Data::Dump; ddx $ENCODING_LOCALE, $ENCODING_LOCALE_FS, $ENCODING_CONSOLE_IN, $ENCODING_CONSOLE_OUT;
+}
+
+_init();
+Encode::Alias::define_alias(sub {
+    no strict 'refs';
+    no warnings 'once';
+    return ${"ENCODING_" . uc(shift)};
+}, "locale");
+
+sub _flush_aliases {
+    no strict 'refs';
+    for my $a (keys %Encode::Alias::Alias) {
+	if (defined ${"ENCODING_" . uc($a)}) {
+	    delete $Encode::Alias::Alias{$a};
+	    warn "Flushed alias cache for $a" if DEBUG;
+	}
+    }
+}
+
+sub reinit {
+    $ENCODING_LOCALE = shift;
+    $ENCODING_LOCALE_FS = shift;
+    $ENCODING_CONSOLE_IN = $ENCODING_LOCALE;
+    $ENCODING_CONSOLE_OUT = $ENCODING_LOCALE;
+    _init();
+    _flush_aliases();
+}
+
+sub decode_argv {
+    die if defined wantarray;
+    for (@ARGV) {
+	$_ = Encode::decode(locale => $_, @_);
+    }
+}
+
+sub env {
+    my $k = Encode::encode(locale => shift);
+    my $old = $ENV{$k};
+    if (@_) {
+	my $v = shift;
+	if (defined $v) {
+	    $ENV{$k} = Encode::encode(locale => $v);
+	}
+	else {
+	    delete $ENV{$k};
+	}
+    }
+    return Encode::decode(locale => $old) if defined wantarray;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+ExtUtils::MakeMaker::Locale - bundled Encode::Locale
+
+=head1 SYNOPSIS
+
+  use Encode::Locale;
+  use Encode;
+
+  $string = decode(locale => $bytes);
+  $bytes = encode(locale => $string);
+
+  if (-t) {
+      binmode(STDIN, ":encoding(console_in)");
+      binmode(STDOUT, ":encoding(console_out)");
+      binmode(STDERR, ":encoding(console_out)");
+  }
+
+  # Processing file names passed in as arguments
+  my $uni_filename = decode(locale => $ARGV[0]);
+  open(my $fh, "<", encode(locale_fs => $uni_filename))
+     || die "Can't open '$uni_filename': $!";
+  binmode($fh, ":encoding(locale)");
+  ...
+
+=head1 DESCRIPTION
+
+In many applications it's wise to let Perl use Unicode for the strings it
+processes.  Most of the interfaces Perl has to the outside world are still byte
+based.  Programs therefore need to decode byte strings that enter the program
+from the outside and encode them again on the way out.
+
+The POSIX locale system is used to specify both the language conventions
+requested by the user and the preferred character set to consume and
+output.  The C<Encode::Locale> module looks up the charset and encoding (called
+a CODESET in the locale jargon) and arranges for the L<Encode> module to know
+this encoding under the name "locale".  It means bytes obtained from the
+environment can be converted to Unicode strings by calling C<<
+Encode::encode(locale => $bytes) >> and converted back again with C<<
+Encode::decode(locale => $string) >>.
+
+Where file systems interfaces pass file names in and out of the program we also
+need care.  The trend is for operating systems to use a fixed file encoding
+that don't actually depend on the locale; and this module determines the most
+appropriate encoding for file names. The L<Encode> module will know this
+encoding under the name "locale_fs".  For traditional Unix systems this will
+be an alias to the same encoding as "locale".
+
+For programs running in a terminal window (called a "Console" on some systems)
+the "locale" encoding is usually a good choice for what to expect as input and
+output.  Some systems allows us to query the encoding set for the terminal and
+C<Encode::Locale> will do that if available and make these encodings known
+under the C<Encode> aliases "console_in" and "console_out".  For systems where
+we can't determine the terminal encoding these will be aliased as the same
+encoding as "locale".  The advice is to use "console_in" for input known to
+come from the terminal and "console_out" for output known to go from the
+terminal.
+
+In addition to arranging for various Encode aliases the following functions and
+variables are provided:
+
+=over
+
+=item decode_argv( )
+
+=item decode_argv( Encode::FB_CROAK )
+
+This will decode the command line arguments to perl (the C<@ARGV> array) in-place.
+
+The function will by default replace characters that can't be decoded by
+"\x{FFFD}", the Unicode replacement character.
+
+Any argument provided is passed as CHECK to underlying Encode::decode() call.
+Pass the value C<Encode::FB_CROAK> to have the decoding croak if not all the
+command line arguments can be decoded.  See L<Encode/"Handling Malformed Data">
+for details on other options for CHECK.
+
+=item env( $uni_key )
+
+=item env( $uni_key => $uni_value )
+
+Interface to get/set environment variables.  Returns the current value as a
+Unicode string. The $uni_key and $uni_value arguments are expected to be
+Unicode strings as well.  Passing C<undef> as $uni_value deletes the
+environment variable named $uni_key.
+
+The returned value will have the characters that can't be decoded replaced by
+"\x{FFFD}", the Unicode replacement character.
+
+There is no interface to request alternative CHECK behavior as for
+decode_argv().  If you need that you need to call encode/decode yourself.
+For example:
+
+    my $key = Encode::encode(locale => $uni_key, Encode::FB_CROAK);
+    my $uni_value = Encode::decode(locale => $ENV{$key}, Encode::FB_CROAK);
+
+=item reinit( )
+
+=item reinit( $encoding )
+
+Reinitialize the encodings from the locale.  You want to call this function if
+you changed anything in the environment that might influence the locale.
+
+This function will croak if the determined encoding isn't recognized by
+the Encode module.
+
+With argument force $ENCODING_... variables to set to the given value.
+
+=item $ENCODING_LOCALE
+
+The encoding name determined to be suitable for the current locale.
+L<Encode> know this encoding as "locale".
+
+=item $ENCODING_LOCALE_FS
+
+The encoding name determined to be suiteable for file system interfaces
+involving file names.
+L<Encode> know this encoding as "locale_fs".
+
+=item $ENCODING_CONSOLE_IN
+
+=item $ENCODING_CONSOLE_OUT
+
+The encodings to be used for reading and writing output to the a console.
+L<Encode> know these encodings as "console_in" and "console_out".
+
+=back
+
+=head1 NOTES
+
+This table summarizes the mapping of the encodings set up
+by the C<Encode::Locale> module:
+
+  Encode      |         |              |
+  Alias       | Windows | Mac OS X     | POSIX
+  ------------+---------+--------------+------------
+  locale      | ANSI    | nl_langinfo  | nl_langinfo
+  locale_fs   | ANSI    | UTF-8        | nl_langinfo
+  console_in  | OEM     | nl_langinfo  | nl_langinfo
+  console_out | OEM     | nl_langinfo  | nl_langinfo
+
+=head2 Windows
+
+Windows has basically 2 sets of APIs.  A wide API (based on passing UTF-16
+strings) and a byte based API based a character set called ANSI.  The
+regular Perl interfaces to the OS currently only uses the ANSI APIs.
+Unfortunately ANSI is not a single character set.
+
+The encoding that corresponds to ANSI varies between different editions of
+Windows.  For many western editions of Windows ANSI corresponds to CP-1252
+which is a character set similar to ISO-8859-1.  Conceptually the ANSI
+character set is a similar concept to the POSIX locale CODESET so this module
+figures out what the ANSI code page is and make this available as
+$ENCODING_LOCALE and the "locale" Encoding alias.
+
+Windows systems also operate with another byte based character set.
+It's called the OEM code page.  This is the encoding that the Console
+takes as input and output.  It's common for the OEM code page to
+differ from the ANSI code page.
+
+=head2 Mac OS X
+
+On Mac OS X the file system encoding is always UTF-8 while the locale
+can otherwise be set up as normal for POSIX systems.
+
+File names on Mac OS X will at the OS-level be converted to
+NFD-form.  A file created by passing a NFC-filename will come
+in NFD-form from readdir().  See L<Unicode::Normalize> for details
+of NFD/NFC.
+
+Actually, Apple does not follow the Unicode NFD standard since not all
+character ranges are decomposed.  The claim is that this avoids problems with
+round trip conversions from old Mac text encodings.  See L<Encode::UTF8Mac> for
+details.
+
+=head2 POSIX (Linux and other Unixes)
+
+File systems might vary in what encoding is to be used for
+filenames.  Since this module has no way to actually figure out
+what the is correct it goes with the best guess which is to
+assume filenames are encoding according to the current locale.
+Users are advised to always specify UTF-8 as the locale charset.
+
+=head1 SEE ALSO
+
+L<I18N::Langinfo>, L<Encode>
+
+=head1 AUTHOR
+
+Copyright 2010 Gisle Aas <gisle@aas.no>.
+
+This library is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+=cut
@@ -1,6 +1,6 @@
 package ExtUtils::MakeMaker::Tutorial;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 
 =head1 NAME
@@ -0,0 +1,123 @@
+#--------------------------------------------------------------------------#
+# This is a modified copy of version.pm 0.9909, bundled exclusively for
+# use by ExtUtils::Makemaker and its dependencies to bootstrap when
+# version.pm is not available.  It should not be used by ordinary modules.
+#--------------------------------------------------------------------------#
+
+package ExtUtils::MakeMaker::version::regex;
+
+use strict;
+
+use vars qw($VERSION $CLASS $STRICT $LAX);
+
+$VERSION = '7.02';
+
+#--------------------------------------------------------------------------#
+# Version regexp components
+#--------------------------------------------------------------------------#
+
+# Fraction part of a decimal version number.  This is a common part of
+# both strict and lax decimal versions
+
+my $FRACTION_PART = qr/\.[0-9]+/;
+
+# First part of either decimal or dotted-decimal strict version number.
+# Unsigned integer with no leading zeroes (except for zero itself) to
+# avoid confusion with octal.
+
+my $STRICT_INTEGER_PART = qr/0|[1-9][0-9]*/;
+
+# First part of either decimal or dotted-decimal lax version number.
+# Unsigned integer, but allowing leading zeros.  Always interpreted
+# as decimal.  However, some forms of the resulting syntax give odd
+# results if used as ordinary Perl expressions, due to how perl treats
+# octals.  E.g.
+#   version->new("010" ) == 10
+#   version->new( 010  ) == 8
+#   version->new( 010.2) == 82  # "8" . "2"
+
+my $LAX_INTEGER_PART = qr/[0-9]+/;
+
+# Second and subsequent part of a strict dotted-decimal version number.
+# Leading zeroes are permitted, and the number is always decimal.
+# Limited to three digits to avoid overflow when converting to decimal
+# form and also avoid problematic style with excessive leading zeroes.
+
+my $STRICT_DOTTED_DECIMAL_PART = qr/\.[0-9]{1,3}/;
+
+# Second and subsequent part of a lax dotted-decimal version number.
+# Leading zeroes are permitted, and the number is always decimal.  No
+# limit on the numerical value or number of digits, so there is the
+# possibility of overflow when converting to decimal form.
+
+my $LAX_DOTTED_DECIMAL_PART = qr/\.[0-9]+/;
+
+# Alpha suffix part of lax version number syntax.  Acts like a
+# dotted-decimal part.
+
+my $LAX_ALPHA_PART = qr/_[0-9]+/;
+
+#--------------------------------------------------------------------------#
+# Strict version regexp definitions
+#--------------------------------------------------------------------------#
+
+# Strict decimal version number.
+
+my $STRICT_DECIMAL_VERSION =
+    qr/ $STRICT_INTEGER_PART $FRACTION_PART? /x;
+
+# Strict dotted-decimal version number.  Must have both leading "v" and
+# at least three parts, to avoid confusion with decimal syntax.
+
+my $STRICT_DOTTED_DECIMAL_VERSION =
+    qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} /x;
+
+# Complete strict version number syntax -- should generally be used
+# anchored: qr/ \A $STRICT \z /x
+
+$STRICT =
+    qr/ $STRICT_DECIMAL_VERSION | $STRICT_DOTTED_DECIMAL_VERSION /x;
+
+#--------------------------------------------------------------------------#
+# Lax version regexp definitions
+#--------------------------------------------------------------------------#
+
+# Lax decimal version number.  Just like the strict one except for
+# allowing an alpha suffix or allowing a leading or trailing
+# decimal-point
+
+my $LAX_DECIMAL_VERSION =
+    qr/ $LAX_INTEGER_PART (?: \. | $FRACTION_PART $LAX_ALPHA_PART? )?
+	|
+	$FRACTION_PART $LAX_ALPHA_PART?
+    /x;
+
+# Lax dotted-decimal version number.  Distinguished by having either
+# leading "v" or at least three non-alpha parts.  Alpha part is only
+# permitted if there are at least two non-alpha parts. Strangely
+# enough, without the leading "v", Perl takes .1.2 to mean v0.1.2,
+# so when there is no "v", the leading part is optional
+
+my $LAX_DOTTED_DECIMAL_VERSION =
+    qr/
+	v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )?
+	|
+	$LAX_INTEGER_PART? $LAX_DOTTED_DECIMAL_PART{2,} $LAX_ALPHA_PART?
+    /x;
+
+# Complete lax version number syntax -- should generally be used
+# anchored: qr/ \A $LAX \z /x
+#
+# The string 'undef' is a special case to make for easier handling
+# of return values from ExtUtils::MM->parse_version
+
+$LAX =
+    qr/ undef | $LAX_DECIMAL_VERSION | $LAX_DOTTED_DECIMAL_VERSION /x;
+
+#--------------------------------------------------------------------------#
+
+# Preloaded methods go here.
+sub is_strict	{ defined $_[0] && $_[0] =~ qr/ \A $STRICT \z /x }
+sub is_lax	{ defined $_[0] && $_[0] =~ qr/ \A $LAX \z /x }
+
+1;
@@ -0,0 +1,1028 @@
+#--------------------------------------------------------------------------#
+# This is a modified copy of version.pm 0.9909, bundled exclusively for
+# use by ExtUtils::Makemaker and its dependencies to bootstrap when
+# version.pm is not available.  It should not be used by ordinary modules.
+#--------------------------------------------------------------------------#
+
+package ExtUtils::MakeMaker::charstar;
+# a little helper class to emulate C char* semantics in Perl
+# so that prescan_version can use the same code as in C
+
+use overload (
+    '""'	=> \&thischar,
+    '0+'	=> \&thischar,
+    '++'	=> \&increment,
+    '--'	=> \&decrement,
+    '+'		=> \&plus,
+    '-'		=> \&minus,
+    '*'		=> \&multiply,
+    'cmp'	=> \&cmp,
+    '<=>'	=> \&spaceship,
+    'bool'	=> \&thischar,
+    '='		=> \&clone,
+);
+
+sub new {
+    my ($self, $string) = @_;
+    my $class = ref($self) || $self;
+
+    my $obj = {
+	string  => [split(//,$string)],
+	current => 0,
+    };
+    return bless $obj, $class;
+}
+
+sub thischar {
+    my ($self) = @_;
+    my $last = $#{$self->{string}};
+    my $curr = $self->{current};
+    if ($curr >= 0 && $curr <= $last) {
+	return $self->{string}->[$curr];
+    }
+    else {
+	return '';
+    }
+}
+
+sub increment {
+    my ($self) = @_;
+    $self->{current}++;
+}
+
+sub decrement {
+    my ($self) = @_;
+    $self->{current}--;
+}
+
+sub plus {
+    my ($self, $offset) = @_;
+    my $rself = $self->clone;
+    $rself->{current} += $offset;
+    return $rself;
+}
+
+sub minus {
+    my ($self, $offset) = @_;
+    my $rself = $self->clone;
+    $rself->{current} -= $offset;
+    return $rself;
+}
+
+sub multiply {
+    my ($left, $right, $swapped) = @_;
+    my $char = $left->thischar();
+    return $char * $right;
+}
+
+sub spaceship {
+    my ($left, $right, $swapped) = @_;
+    unless (ref($right)) { # not an object already
+	$right = $left->new($right);
+    }
+    return $left->{current} <=> $right->{current};
+}
+
+sub cmp {
+    my ($left, $right, $swapped) = @_;
+    unless (ref($right)) { # not an object already
+	if (length($right) == 1) { # comparing single character only
+	    return $left->thischar cmp $right;
+	}
+	$right = $left->new($right);
+    }
+    return $left->currstr cmp $right->currstr;
+}
+
+sub bool {
+    my ($self) = @_;
+    my $char = $self->thischar;
+    return ($char ne '');
+}
+
+sub clone {
+    my ($left, $right, $swapped) = @_;
+    $right = {
+	string  => [@{$left->{string}}],
+	current => $left->{current},
+    };
+    return bless $right, ref($left);
+}
+
+sub currstr {
+    my ($self, $s) = @_;
+    my $curr = $self->{current};
+    my $last = $#{$self->{string}};
+    if (defined($s) && $s->{current} < $last) {
+	$last = $s->{current};
+    }
+
+    my $string = join('', @{$self->{string}}[$curr..$last]);
+    return $string;
+}
+
+package ExtUtils::MakeMaker::version::vpp;
+
+use 5.006002;
+use strict;
+
+use Config;
+use vars qw($VERSION $CLASS @ISA $LAX $STRICT);
+$VERSION = '7.02';
+$CLASS = 'ExtUtils::MakeMaker::version::vpp';
+
+require ExtUtils::MakeMaker::version::regex;
+*ExtUtils::MakeMaker::version::vpp::is_strict = \&ExtUtils::MakeMaker::version::regex::is_strict;
+*ExtUtils::MakeMaker::version::vpp::is_lax = \&ExtUtils::MakeMaker::version::regex::is_lax;
+*LAX = \$ExtUtils::MakeMaker::version::regex::LAX;
+*STRICT = \$ExtUtils::MakeMaker::version::regex::STRICT;
+
+use overload (
+    '""'       => \&stringify,
+    '0+'       => \&numify,
+    'cmp'      => \&vcmp,
+    '<=>'      => \&vcmp,
+    'bool'     => \&vbool,
+    '+'        => \&vnoop,
+    '-'        => \&vnoop,
+    '*'        => \&vnoop,
+    '/'        => \&vnoop,
+    '+='        => \&vnoop,
+    '-='        => \&vnoop,
+    '*='        => \&vnoop,
+    '/='        => \&vnoop,
+    'abs'      => \&vnoop,
+);
+
+eval "use warnings";
+if ($@) {
+    eval '
+	package
+	warnings;
+	sub enabled {return $^W;}
+	1;
+    ';
+}
+
+sub import {
+    no strict 'refs';
+    my ($class) = shift;
+
+    # Set up any derived class
+    unless ($class eq $CLASS) {
+	local $^W;
+	*{$class.'::declare'} =  \&{$CLASS.'::declare'};
+	*{$class.'::qv'} = \&{$CLASS.'::qv'};
+    }
+
+    my %args;
+    if (@_) { # any remaining terms are arguments
+	map { $args{$_} = 1 } @_
+    }
+    else { # no parameters at all on use line
+	%args =
+	(
+	    qv => 1,
+	    'UNIVERSAL::VERSION' => 1,
+	);
+    }
+
+    my $callpkg = caller();
+
+    if (exists($args{declare})) {
+	*{$callpkg.'::declare'} =
+	    sub {return $class->declare(shift) }
+	  unless defined(&{$callpkg.'::declare'});
+    }
+
+    if (exists($args{qv})) {
+	*{$callpkg.'::qv'} =
+	    sub {return $class->qv(shift) }
+	  unless defined(&{$callpkg.'::qv'});
+    }
+
+    if (exists($args{'UNIVERSAL::VERSION'})) {
+	local $^W;
+	*UNIVERSAL::VERSION
+		= \&{$CLASS.'::_VERSION'};
+    }
+
+    if (exists($args{'VERSION'})) {
+	*{$callpkg.'::VERSION'} = \&{$CLASS.'::_VERSION'};
+    }
+
+    if (exists($args{'is_strict'})) {
+	*{$callpkg.'::is_strict'} = \&{$CLASS.'::is_strict'}
+	  unless defined(&{$callpkg.'::is_strict'});
+    }
+
+    if (exists($args{'is_lax'})) {
+	*{$callpkg.'::is_lax'} = \&{$CLASS.'::is_lax'}
+	  unless defined(&{$callpkg.'::is_lax'});
+    }
+}
+
+my $VERSION_MAX = 0x7FFFFFFF;
+
+# implement prescan_version as closely to the C version as possible
+use constant TRUE  => 1;
+use constant FALSE => 0;
+
+sub isDIGIT {
+    my ($char) = shift->thischar();
+    return ($char =~ /\d/);
+}
+
+sub isALPHA {
+    my ($char) = shift->thischar();
+    return ($char =~ /[a-zA-Z]/);
+}
+
+sub isSPACE {
+    my ($char) = shift->thischar();
+    return ($char =~ /\s/);
+}
+
+sub BADVERSION {
+    my ($s, $errstr, $error) = @_;
+    if ($errstr) {
+	$$errstr = $error;
+    }
+    return $s;
+}
+
+sub prescan_version {
+    my ($s, $strict, $errstr, $sqv, $ssaw_decimal, $swidth, $salpha) = @_;
+    my $qv          = defined $sqv          ? $$sqv          : FALSE;
+    my $saw_decimal = defined $ssaw_decimal ? $$ssaw_decimal : 0;
+    my $width       = defined $swidth       ? $$swidth       : 3;
+    my $alpha       = defined $salpha       ? $$salpha       : FALSE;
+
+    my $d = $s;
+
+    if ($qv && isDIGIT($d)) {
+	goto dotted_decimal_version;
+    }
+
+    if ($d eq 'v') { # explicit v-string
+	$d++;
+	if (isDIGIT($d)) {
+	    $qv = TRUE;
+	}
+	else { # degenerate v-string
+	    # requires v1.2.3
+	    return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
+	}
+
+dotted_decimal_version:
+	if ($strict && $d eq '0' && isDIGIT($d+1)) {
+	    # no leading zeros allowed
+	    return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)");
+	}
+
+	while (isDIGIT($d)) { 	# integer part
+	    $d++;
+	}
+
+	if ($d eq '.')
+	{
+	    $saw_decimal++;
+	    $d++; 		# decimal point
+	}
+	else
+	{
+	    if ($strict) {
+		# require v1.2.3
+		return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
+	    }
+	    else {
+		goto version_prescan_finish;
+	    }
+	}
+
+	{
+	    my $i = 0;
+	    my $j = 0;
+	    while (isDIGIT($d)) {	# just keep reading
+		$i++;
+		while (isDIGIT($d)) {
+		    $d++; $j++;
+		    # maximum 3 digits between decimal
+		    if ($strict && $j > 3) {
+			return BADVERSION($s,$errstr,"Invalid version format (maximum 3 digits between decimals)");
+		    }
+		}
+		if ($d eq '_') {
+		    if ($strict) {
+			return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
+		    }
+		    if ( $alpha ) {
+			return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)");
+		    }
+		    $d++;
+		    $alpha = TRUE;
+		}
+		elsif ($d eq '.') {
+		    if ($alpha) {
+			return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)");
+		    }
+		    $saw_decimal++;
+		    $d++;
+		}
+		elsif (!isDIGIT($d)) {
+		    last;
+		}
+		$j = 0;
+	    }
+
+	    if ($strict && $i < 2) {
+		# requires v1.2.3
+		return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions require at least three parts)");
+	    }
+	}
+    } 					# end if dotted-decimal
+    else
+    {					# decimal versions
+	my $j = 0;
+	# special $strict case for leading '.' or '0'
+	if ($strict) {
+	    if ($d eq '.') {
+		return BADVERSION($s,$errstr,"Invalid version format (0 before decimal required)");
+	    }
+	    if ($d eq '0' && isDIGIT($d+1)) {
+		return BADVERSION($s,$errstr,"Invalid version format (no leading zeros)");
+	    }
+	}
+
+	# and we never support negative version numbers
+	if ($d eq '-') {
+	    return BADVERSION($s,$errstr,"Invalid version format (negative version number)");
+	}
+
+	# consume all of the integer part
+	while (isDIGIT($d)) {
+	    $d++;
+	}
+
+	# look for a fractional part
+	if ($d eq '.') {
+	    # we found it, so consume it
+	    $saw_decimal++;
+	    $d++;
+	}
+	elsif (!$d || $d eq ';' || isSPACE($d) || $d eq '}') {
+	    if ( $d == $s ) {
+		# found nothing
+		return BADVERSION($s,$errstr,"Invalid version format (version required)");
+	    }
+	    # found just an integer
+	    goto version_prescan_finish;
+	}
+	elsif ( $d == $s ) {
+	    # didn't find either integer or period
+	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
+	}
+	elsif ($d eq '_') {
+	    # underscore can't come after integer part
+	    if ($strict) {
+		return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
+	    }
+	    elsif (isDIGIT($d+1)) {
+		return BADVERSION($s,$errstr,"Invalid version format (alpha without decimal)");
+	    }
+	    else {
+		return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)");
+	    }
+	}
+	elsif ($d) {
+	    # anything else after integer part is just invalid data
+	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
+	}
+
+	# scan the fractional part after the decimal point
+	if ($d && !isDIGIT($d) && ($strict || ! ($d eq ';' || isSPACE($d) || $d eq '}') )) {
+		# $strict or lax-but-not-the-end
+		return BADVERSION($s,$errstr,"Invalid version format (fractional part required)");
+	}
+
+	while (isDIGIT($d)) {
+	    $d++; $j++;
+	    if ($d eq '.' && isDIGIT($d-1)) {
+		if ($alpha) {
+		    return BADVERSION($s,$errstr,"Invalid version format (underscores before decimal)");
+		}
+		if ($strict) {
+		    return BADVERSION($s,$errstr,"Invalid version format (dotted-decimal versions must begin with 'v')");
+		}
+		$d = $s; # start all over again
+		$qv = TRUE;
+		goto dotted_decimal_version;
+	    }
+	    if ($d eq '_') {
+		if ($strict) {
+		    return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
+		}
+		if ( $alpha ) {
+		    return BADVERSION($s,$errstr,"Invalid version format (multiple underscores)");
+		}
+		if ( ! isDIGIT($d+1) ) {
+		    return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)");
+		}
+		$width = $j;
+		$d++;
+		$alpha = TRUE;
+	    }
+	}
+    }
+
+version_prescan_finish:
+    while (isSPACE($d)) {
+	$d++;
+    }
+
+    if ($d && !isDIGIT($d) && (! ($d eq ';' || $d eq '}') )) {
+	# trailing non-numeric data
+	return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
+    }
+
+    if (defined $sqv) {
+	$$sqv = $qv;
+    }
+    if (defined $swidth) {
+	$$swidth = $width;
+    }
+    if (defined $ssaw_decimal) {
+	$$ssaw_decimal = $saw_decimal;
+    }
+    if (defined $salpha) {
+	$$salpha = $alpha;
+    }
+    return $d;
+}
+
+sub scan_version {
+    my ($s, $rv, $qv) = @_;
+    my $start;
+    my $pos;
+    my $last;
+    my $errstr;
+    my $saw_decimal = 0;
+    my $width = 3;
+    my $alpha = FALSE;
+    my $vinf = FALSE;
+    my @av;
+
+    $s = new ExtUtils::MakeMaker::charstar $s;
+
+    while (isSPACE($s)) { # leading whitespace is OK
+	$s++;
+    }
+
+    $last = prescan_version($s, FALSE, \$errstr, \$qv, \$saw_decimal,
+	\$width, \$alpha);
+
+    if ($errstr) {
+	# 'undef' is a special case and not an error
+	if ( $s ne 'undef') {
+	    require Carp;
+	    Carp::croak($errstr);
+	}
+    }
+
+    $start = $s;
+    if ($s eq 'v') {
+	$s++;
+    }
+    $pos = $s;
+
+    if ( $qv ) {
+	$$rv->{qv} = $qv;
+    }
+    if ( $alpha ) {
+	$$rv->{alpha} = $alpha;
+    }
+    if ( !$qv && $width < 3 ) {
+	$$rv->{width} = $width;
+    }
+
+    while (isDIGIT($pos)) {
+	$pos++;
+    }
+    if (!isALPHA($pos)) {
+	my $rev;
+
+	for (;;) {
+	    $rev = 0;
+	    {
+  		# this is atoi() that delimits on underscores
+  		my $end = $pos;
+  		my $mult = 1;
+		my $orev;
+
+		#  the following if() will only be true after the decimal
+		#  point of a version originally created with a bare
+		#  floating point number, i.e. not quoted in any way
+		#
+ 		if ( !$qv && $s > $start && $saw_decimal == 1 ) {
+		    $mult *= 100;
+ 		    while ( $s < $end ) {
+			$orev = $rev;
+ 			$rev += $s * $mult;
+ 			$mult /= 10;
+			if (   (abs($orev) > abs($rev))
+			    || (abs($rev) > $VERSION_MAX )) {
+			    warn("Integer overflow in version %d",
+					   $VERSION_MAX);
+			    $s = $end - 1;
+			    $rev = $VERSION_MAX;
+			    $vinf = 1;
+			}
+ 			$s++;
+			if ( $s eq '_' ) {
+			    $s++;
+			}
+ 		    }
+  		}
+ 		else {
+ 		    while (--$end >= $s) {
+			$orev = $rev;
+ 			$rev += $end * $mult;
+ 			$mult *= 10;
+			if (   (abs($orev) > abs($rev))
+			    || (abs($rev) > $VERSION_MAX )) {
+			    warn("Integer overflow in version");
+			    $end = $s - 1;
+			    $rev = $VERSION_MAX;
+			    $vinf = 1;
+			}
+ 		    }
+ 		}
+  	    }
+
+  	    # Append revision
+	    push @av, $rev;
+	    if ( $vinf ) {
+		$s = $last;
+		last;
+	    }
+	    elsif ( $pos eq '.' ) {
+		$s = ++$pos;
+	    }
+	    elsif ( $pos eq '_' && isDIGIT($pos+1) ) {
+		$s = ++$pos;
+	    }
+	    elsif ( $pos eq ',' && isDIGIT($pos+1) ) {
+		$s = ++$pos;
+	    }
+	    elsif ( isDIGIT($pos) ) {
+		$s = $pos;
+	    }
+	    else {
+		$s = $pos;
+		last;
+	    }
+	    if ( $qv ) {
+		while ( isDIGIT($pos) ) {
+		    $pos++;
+		}
+	    }
+	    else {
+		my $digits = 0;
+		while ( ( isDIGIT($pos) || $pos eq '_' ) && $digits < 3 ) {
+		    if ( $pos ne '_' ) {
+			$digits++;
+		    }
+		    $pos++;
+		}
+	    }
+	}
+    }
+    if ( $qv ) { # quoted versions always get at least three terms
+	my $len = $#av;
+	#  This for loop appears to trigger a compiler bug on OS X, as it
+	#  loops infinitely. Yes, len is negative. No, it makes no sense.
+	#  Compiler in question is:
+	#  gcc version 3.3 20030304 (Apple Computer, Inc. build 1640)
+	#  for ( len = 2 - len; len > 0; len-- )
+	#  av_push(MUTABLE_AV(sv), newSViv(0));
+	#
+	$len = 2 - $len;
+	while ($len-- > 0) {
+	    push @av, 0;
+	}
+    }
+
+    # need to save off the current version string for later
+    if ( $vinf ) {
+	$$rv->{original} = "v.Inf";
+	$$rv->{vinf} = 1;
+    }
+    elsif ( $s > $start ) {
+	$$rv->{original} = $start->currstr($s);
+	if ( $qv && $saw_decimal == 1 && $start ne 'v' ) {
+	    # need to insert a v to be consistent
+	    $$rv->{original} = 'v' . $$rv->{original};
+	}
+    }
+    else {
+	$$rv->{original} = '0';
+	push(@av, 0);
+    }
+
+    # And finally, store the AV in the hash
+    $$rv->{version} = \@av;
+
+    # fix RT#19517 - special case 'undef' as string
+    if ($s eq 'undef') {
+	$s += 5;
+    }
+
+    return $s;
+}
+
+sub new {
+    my $class = shift;
+    unless (defined $class or $#_ > 1) {
+	require Carp;
+	Carp::croak('Usage: version::new(class, version)');
+    }
+
+    my $self = bless ({}, ref ($class) || $class);
+    my $qv = FALSE;
+
+    if ( $#_ == 1 ) { # must be CVS-style
+	$qv = TRUE;
+    }
+    my $value = pop; # always going to be the last element
+
+    if ( ref($value) && eval('$value->isa("version")') ) {
+	# Can copy the elements directly
+	$self->{version} = [ @{$value->{version} } ];
+	$self->{qv} = 1 if $value->{qv};
+	$self->{alpha} = 1 if $value->{alpha};
+	$self->{original} = ''.$value->{original};
+	return $self;
+    }
+
+    if ( not defined $value or $value =~ /^undef$/ ) {
+	# RT #19517 - special case for undef comparison
+	# or someone forgot to pass a value
+	push @{$self->{version}}, 0;
+	$self->{original} = "0";
+	return ($self);
+    }
+
+
+    if (ref($value) =~ m/ARRAY|HASH/) {
+	require Carp;
+	Carp::croak("Invalid version format (non-numeric data)");
+    }
+
+    $value = _un_vstring($value);
+
+    if ($Config{d_setlocale} && eval { require POSIX } ) {
+      require locale;
+	my $currlocale = POSIX::setlocale(&POSIX::LC_ALL);
+
+	# if the current locale uses commas for decimal points, we
+	# just replace commas with decimal places, rather than changing
+	# locales
+	if ( POSIX::localeconv()->{decimal_point} eq ',' ) {
+	    $value =~ tr/,/./;
+	}
+    }
+
+    # exponential notation
+    if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
+	$value = sprintf("%.9f",$value);
+	$value =~ s/(0+)$//; # trim trailing zeros
+    }
+
+    my $s = scan_version($value, \$self, $qv);
+
+    if ($s) { # must be something left over
+	warn("Version string '%s' contains invalid data; "
+		   ."ignoring: '%s'", $value, $s);
+    }
+
+    return ($self);
+}
+
+*parse = \&new;
+
+sub numify {
+    my ($self) = @_;
+    unless (_verify($self)) {
+	require Carp;
+	Carp::croak("Invalid version object");
+    }
+    my $width = $self->{width} || 3;
+    my $alpha = $self->{alpha} || "";
+    my $len = $#{$self->{version}};
+    my $digit = $self->{version}[0];
+    my $string = sprintf("%d.", $digit );
+
+    for ( my $i = 1 ; $i < $len ; $i++ ) {
+	$digit = $self->{version}[$i];
+	if ( $width < 3 ) {
+	    my $denom = 10**(3-$width);
+	    my $quot = int($digit/$denom);
+	    my $rem = $digit - ($quot * $denom);
+	    $string .= sprintf("%0".$width."d_%d", $quot, $rem);
+	}
+	else {
+	    $string .= sprintf("%03d", $digit);
+	}
+    }
+
+    if ( $len > 0 ) {
+	$digit = $self->{version}[$len];
+	if ( $alpha && $width == 3 ) {
+	    $string .= "_";
+	}
+	$string .= sprintf("%0".$width."d", $digit);
+    }
+    else # $len = 0
+    {
+	$string .= sprintf("000");
+    }
+
+    return $string;
+}
+
+sub normal {
+    my ($self) = @_;
+    unless (_verify($self)) {
+	require Carp;
+	Carp::croak("Invalid version object");
+    }
+    my $alpha = $self->{alpha} || "";
+    my $len = $#{$self->{version}};
+    my $digit = $self->{version}[0];
+    my $string = sprintf("v%d", $digit );
+
+    for ( my $i = 1 ; $i < $len ; $i++ ) {
+	$digit = $self->{version}[$i];
+	$string .= sprintf(".%d", $digit);
+    }
+
+    if ( $len > 0 ) {
+	$digit = $self->{version}[$len];
+	if ( $alpha ) {
+	    $string .= sprintf("_%0d", $digit);
+	}
+	else {
+	    $string .= sprintf(".%0d", $digit);
+	}
+    }
+
+    if ( $len <= 2 ) {
+	for ( $len = 2 - $len; $len != 0; $len-- ) {
+	    $string .= sprintf(".%0d", 0);
+	}
+    }
+
+    return $string;
+}
+
+sub stringify {
+    my ($self) = @_;
+    unless (_verify($self)) {
+	require Carp;
+	Carp::croak("Invalid version object");
+    }
+    return exists $self->{original}
+    	? $self->{original}
+	: exists $self->{qv}
+	    ? $self->normal
+	    : $self->numify;
+}
+
+sub vcmp {
+    require UNIVERSAL;
+    my ($left,$right,$swap) = @_;
+    my $class = ref($left);
+    unless ( UNIVERSAL::isa($right, $class) ) {
+	$right = $class->new($right);
+    }
+
+    if ( $swap ) {
+	($left, $right) = ($right, $left);
+    }
+    unless (_verify($left)) {
+	require Carp;
+	Carp::croak("Invalid version object");
+    }
+    unless (_verify($right)) {
+	require Carp;
+	Carp::croak("Invalid version format");
+    }
+    my $l = $#{$left->{version}};
+    my $r = $#{$right->{version}};
+    my $m = $l < $r ? $l : $r;
+    my $lalpha = $left->is_alpha;
+    my $ralpha = $right->is_alpha;
+    my $retval = 0;
+    my $i = 0;
+    while ( $i <= $m && $retval == 0 ) {
+	$retval = $left->{version}[$i] <=> $right->{version}[$i];
+	$i++;
+    }
+
+    # tiebreaker for alpha with identical terms
+    if ( $retval == 0
+	&& $l == $r
+	&& $left->{version}[$m] == $right->{version}[$m]
+	&& ( $lalpha || $ralpha ) ) {
+
+	if ( $lalpha && !$ralpha ) {
+	    $retval = -1;
+	}
+	elsif ( $ralpha && !$lalpha) {
+	    $retval = +1;
+	}
+    }
+
+    # possible match except for trailing 0's
+    if ( $retval == 0 && $l != $r ) {
+	if ( $l < $r ) {
+	    while ( $i <= $r && $retval == 0 ) {
+		if ( $right->{version}[$i] != 0 ) {
+		    $retval = -1; # not a match after all
+		}
+		$i++;
+	    }
+	}
+	else {
+	    while ( $i <= $l && $retval == 0 ) {
+		if ( $left->{version}[$i] != 0 ) {
+		    $retval = +1; # not a match after all
+		}
+		$i++;
+	    }
+	}
+    }
+
+    return $retval;
+}
+
+sub vbool {
+    my ($self) = @_;
+    return vcmp($self,$self->new("0"),1);
+}
+
+sub vnoop {
+    require Carp;
+    Carp::croak("operation not supported with version object");
+}
+
+sub is_alpha {
+    my ($self) = @_;
+    return (exists $self->{alpha});
+}
+
+sub qv {
+    my $value = shift;
+    my $class = $CLASS;
+    if (@_) {
+	$class = ref($value) || $value;
+	$value = shift;
+    }
+
+    $value = _un_vstring($value);
+    $value = 'v'.$value unless $value =~ /(^v|\d+\.\d+\.\d)/;
+    my $obj = $CLASS->new($value);
+    return bless $obj, $class;
+}
+
+*declare = \&qv;
+
+sub is_qv {
+    my ($self) = @_;
+    return (exists $self->{qv});
+}
+
+
+sub _verify {
+    my ($self) = @_;
+    if ( ref($self)
+	&& eval { exists $self->{version} }
+	&& ref($self->{version}) eq 'ARRAY'
+	) {
+	return 1;
+    }
+    else {
+	return 0;
+    }
+}
+
+sub _is_non_alphanumeric {
+    my $s = shift;
+    $s = new ExtUtils::MakeMaker::charstar $s;
+    while ($s) {
+	return 0 if isSPACE($s); # early out
+	return 1 unless (isALPHA($s) || isDIGIT($s) || $s =~ /[.-]/);
+	$s++;
+    }
+    return 0;
+}
+
+sub _un_vstring {
+    my $value = shift;
+    # may be a v-string
+    if ( length($value) >= 3 && $value !~ /[._]/
+	&& _is_non_alphanumeric($value)) {
+	my $tvalue;
+	if ( $] ge 5.008_001 ) {
+	    $tvalue = _find_magic_vstring($value);
+	    $value = $tvalue if length $tvalue;
+	}
+	elsif ( $] ge 5.006_000 ) {
+	    $tvalue = sprintf("v%vd",$value);
+	    if ( $tvalue =~ /^v\d+(\.\d+){2,}$/ ) {
+		# must be a v-string
+		$value = $tvalue;
+	    }
+	}
+    }
+    return $value;
+}
+
+sub _find_magic_vstring {
+    my $value = shift;
+    my $tvalue = '';
+    require B;
+    my $sv = B::svref_2object(\$value);
+    my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
+    while ( $magic ) {
+	if ( $magic->TYPE eq 'V' ) {
+	    $tvalue = $magic->PTR;
+	    $tvalue =~ s/^v?(.+)$/v$1/;
+	    last;
+	}
+	else {
+	    $magic = $magic->MOREMAGIC;
+	}
+    }
+    return $tvalue;
+}
+
+sub _VERSION {
+    my ($obj, $req) = @_;
+    my $class = ref($obj) || $obj;
+
+    no strict 'refs';
+    if ( exists $INC{"$class.pm"} and not %{"$class\::"} and $] >= 5.008) {
+	 # file but no package
+	require Carp;
+	Carp::croak( "$class defines neither package nor VERSION"
+	    ."--version check failed");
+    }
+
+    my $version = eval "\$$class\::VERSION";
+    if ( defined $version ) {
+	local $^W if $] <= 5.008;
+	$version = ExtUtils::MakeMaker::version::vpp->new($version);
+    }
+
+    if ( defined $req ) {
+	unless ( defined $version ) {
+	    require Carp;
+	    my $msg =  $] < 5.006
+	    ? "$class version $req required--this is only version "
+	    : "$class does not define \$$class\::VERSION"
+	      ."--version check failed";
+
+	    if ( $ENV{VERSION_DEBUG} ) {
+		Carp::confess($msg);
+	    }
+	    else {
+		Carp::croak($msg);
+	    }
+	}
+
+	$req = ExtUtils::MakeMaker::version::vpp->new($req);
+
+	if ( $req > $version ) {
+	    require Carp;
+	    if ( $req->is_qv ) {
+		Carp::croak(
+		    sprintf ("%s version %s required--".
+			"this is only version %s", $class,
+			$req->normal, $version->normal)
+		);
+	    }
+	    else {
+		Carp::croak(
+		    sprintf ("%s version %s required--".
+			"this is only version %s", $class,
+			$req->stringify, $version->stringify)
+		);
+	    }
+	}
+    }
+
+    return defined $version ? $version->stringify : undef;
+}
+
+1; #this line is important and will help the module return a true value
@@ -0,0 +1,55 @@
+#--------------------------------------------------------------------------#
+# This is a modified copy of version.pm 0.9909, bundled exclusively for
+# use by ExtUtils::Makemaker and its dependencies to bootstrap when
+# version.pm is not available.  It should not be used by ordinary modules.
+#
+# When loaded, it will try to load version.pm.  If that fails, it will load
+# ExtUtils::MakeMaker::version::vpp and alias various *version functions
+# to functions in that module.  It will also override UNIVERSAL::VERSION.
+#--------------------------------------------------------------------------#
+
+package ExtUtils::MakeMaker::version;
+
+use 5.006002;
+use strict;
+
+use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
+
+$VERSION = '7.02';
+$CLASS = 'version';
+
+{
+    local $SIG{'__DIE__'};
+    eval "use version";
+    if ( $@ ) { # don't have any version.pm installed
+        eval "use ExtUtils::MakeMaker::version::vpp";
+        die "$@" if ( $@ );
+        local $^W;
+        delete $INC{'version.pm'};
+        $INC{'version.pm'} = $INC{'ExtUtils/MakeMaker/version.pm'};
+        push @version::ISA, "ExtUtils::MakeMaker::version::vpp";
+        $version::VERSION = $VERSION;
+        *version::qv = \&ExtUtils::MakeMaker::version::vpp::qv;
+        *version::declare = \&ExtUtils::MakeMaker::version::vpp::declare;
+        *version::_VERSION = \&ExtUtils::MakeMaker::version::vpp::_VERSION;
+        *version::vcmp = \&ExtUtils::MakeMaker::version::vpp::vcmp;
+        *version::new = \&ExtUtils::MakeMaker::version::vpp::new;
+        if ($] >= 5.009000) {
+            no strict 'refs';
+            *version::stringify = \&ExtUtils::MakeMaker::version::vpp::stringify;
+            *{'version::(""'} = \&ExtUtils::MakeMaker::version::vpp::stringify;
+            *{'version::(<=>'} = \&ExtUtils::MakeMaker::version::vpp::vcmp;
+            *version::parse = \&ExtUtils::MakeMaker::version::vpp::parse;
+        }
+        require ExtUtils::MakeMaker::version::regex;
+        *version::is_lax = \&ExtUtils::MakeMaker::version::regex::is_lax;
+        *version::is_strict = \&ExtUtils::MakeMaker::version::regex::is_strict;
+        *LAX = \$ExtUtils::MakeMaker::version::regex::LAX;
+        *STRICT = \$ExtUtils::MakeMaker::version::regex::STRICT;
+    }
+    elsif ( ! version->can('is_qv') ) {
+        *version::is_qv = sub { exists $_[0]->{qv} };
+    }
+}
+
+1;
@@ -7,8 +7,12 @@ BEGIN {require 5.006;}
 
 require Exporter;
 use ExtUtils::MakeMaker::Config;
+use ExtUtils::MakeMaker::version; # ensure we always have or fake version.pm
 use Carp;
 use File::Path;
+my $CAN_DECODE = eval { require ExtUtils::MakeMaker::Locale; }; # 2 birds, 1 stone
+eval { ExtUtils::MakeMaker::Locale::reinit('UTF-8') }
+  if $CAN_DECODE and $ExtUtils::MakeMaker::Locale::ENCODING_LOCALE eq 'US-ASCII';
 
 our $Verbose = 0;       # exported
 our @Parent;            # needs to be localized
@@ -17,8 +21,10 @@ our @MM_Sections;
 our @Overridable;
 my @Prepend_parent;
 my %Recognized_Att_Keys;
+our %macro_fsentity; # whether a macro is a filesystem name
+our %macro_dep; # whether a macro is a dependency
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 $VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
 
 # Emulate something resembling CVS $Revision$
@@ -28,7 +34,7 @@ $Revision = int $Revision * 10000;
 our $Filename = __FILE__;   # referenced outside MakeMaker
 
 our @ISA = qw(Exporter);
-our @EXPORT    = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
+our @EXPORT    = qw(&WriteMakefile $Verbose &prompt);
 our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
                     &WriteEmptyMakefile);
 
@@ -36,6 +42,7 @@ our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
 # purged.
 my $Is_VMS     = $^O eq 'VMS';
 my $Is_Win32   = $^O eq 'MSWin32';
+my $UNDER_CORE = $ENV{PERL_CORE};
 
 full_setup();
 
@@ -250,14 +257,12 @@ my $PACKNAME = 'PACK000';
 sub full_setup {
     $Verbose ||= 0;
 
-    my @attrib_help = qw/
+    my @dep_macros = qw/
+    PERL_INCDEP        PERL_ARCHLIBDEP     PERL_ARCHIVEDEP
+    /;
 
-    AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
-    C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME
-    DL_FUNCS DL_VARS
-    EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
-    FULLPERL FULLPERLRUN FULLPERLRUNINST
-    FUNCLIST H IMPORTS
+    my @fs_macros = qw/
+    FULLPERL XSUBPPDIR
 
     INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR
     INSTALLDIRS
@@ -273,22 +278,41 @@ sub full_setup {
     PERL_LIB        PERL_ARCHLIB
     SITELIBEXP      SITEARCHEXP
 
-    INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
-    LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
+    MAKE LIBPERL_A LIB PERL_SRC PERL_INC
+    PPM_INSTALL_EXEC PPM_UNINSTALL_EXEC
+    PPM_INSTALL_SCRIPT PPM_UNINSTALL_SCRIPT
+    /;
+
+    my @attrib_help = qw/
+
+    AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
+    C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME
+    DL_FUNCS DL_VARS
+    EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
+    FULLPERLRUN FULLPERLRUNINST
+    FUNCLIST H IMPORTS
+
+    INC INCLUDE_EXT LDFROM LIBS LICENSE
+    LINKTYPE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
     META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES CONFIGURE_REQUIRES
     MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NO_MYMETA NO_PACKLIST NO_PERLLOCAL
     NORECURS NO_VC OBJECT OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN
     PERLRUNINST PERL_CORE
-    PERL_SRC PERM_DIR PERM_RW PERM_RWX MAGICXS
-    PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC PPM_UNINSTALL_EXEC
-    PPM_INSTALL_SCRIPT PPM_UNINSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
+    PERM_DIR PERM_RW PERM_RWX MAGICXS
+    PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE
+    PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
     SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS XSOPT XSPROTOARG
     XS_VERSION clean depend dist dynamic_lib linkext macro realclean
     tool_autosplit
 
+    MAN1EXT MAN3EXT
+
     MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC
     MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED
         /;
+    push @attrib_help, @fs_macros;
+    @macro_fsentity{@fs_macros, @dep_macros} = (1) x (@fs_macros+@dep_macros);
+    @macro_dep{@dep_macros} = (1) x @dep_macros;
 
     # IMPORTS is used under OS/2 and Win32
 
@@ -381,26 +405,6 @@ sub full_setup {
     );
 }
 
-sub writeMakefile {
-    die <<END;
-
-The extension you are trying to build apparently is rather old and
-most probably outdated. We detect that from the fact, that a
-subroutine "writeMakefile" is called, and this subroutine is not
-supported anymore since about October 1994.
-
-Please contact the author or look into CPAN (details about CPAN can be
-found in the FAQ and at http:/www.perl.com) for a more recent version
-of the extension. If you're really desperate, you can try to change
-the subroutine name from writeMakefile to WriteMakefile and rerun
-'perl Makefile.PL', but you're most probably left alone, when you do
-so.
-
-The MakeMaker team
-
-END
-}
-
 sub new {
     my($class,$self) = @_;
     my($key);
@@ -449,7 +453,7 @@ sub new {
             # simulate "use warnings FATAL => 'all'" for vintage perls
             die @_;
         };
-        version->parse( $self->{MIN_PERL_VERSION} )
+        version->new( $self->{MIN_PERL_VERSION} )
       };
       $self->{MIN_PERL_VERSION} = $normal if defined $normal && !$@;
     }
@@ -502,7 +506,7 @@ END
           if ( defined $required_version && $required_version =~ /^v?[\d_\.]+$/
                || $required_version !~ /^v?[\d_\.]+$/ ) {
             require version;
-            my $normal = eval { version->parse( $required_version ) };
+            my $normal = eval { version->new( $required_version ) };
             $required_version = $normal if defined $normal;
           }
           $installed_file = $prereq;
@@ -585,10 +589,7 @@ END
 
             $self->{$key} = $self->{PARENT}{$key};
 
-            unless ($Is_VMS && $key =~ /PERL$/) {
-                $self->{$key} = $self->catdir("..",$self->{$key})
-                  unless $self->file_name_is_absolute($self->{$key});
-            } else {
+            if ($Is_VMS && $key =~ /PERL$/) {
                 # PERL or FULLPERL will be a command verb or even a
                 # command with an argument instead of a full file
                 # specification under VMS.  So, don't turn the command
@@ -598,6 +599,14 @@ END
                 $cmd[1] = $self->catfile('[-]',$cmd[1])
                   unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
                 $self->{$key} = join(' ', @cmd);
+            } else {
+                my $value = $self->{$key};
+                # not going to test in FS so only stripping start
+                $value =~ s/^"// if $key =~ /PERL$/;
+                $value = $self->catdir("..", $value)
+                  unless $self->file_name_is_absolute($value);
+                $value = qq{"$value} if $key =~ /PERL$/;
+                $self->{$key} = $value;
             }
         }
         if ($self->{PARENT}) {
@@ -821,7 +830,7 @@ END
 
     foreach my $key (sort keys %$att){
         next if $key eq 'ARGS';
-        my ($v) = neatvalue($att->{$key});
+        my $v;
         if ($key eq 'PREREQ_PM') {
             # CPAN.pm takes prereqs from this field in 'Makefile'
             # and does not know about BUILD_REQUIRES
@@ -938,6 +947,7 @@ sub check_manifest {
 
 sub parse_args{
     my($self, @args) = @_;
+    @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE;
     foreach (@args) {
         unless (m/(.*?)=(.*)/) {
             ++$Verbose if m/^verb/;
@@ -1162,8 +1172,13 @@ sub flush {
     unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ());
     open(my $fh,">", "MakeMaker.tmp")
         or die "Unable to open MakeMaker.tmp: $!";
+    binmode $fh, ':encoding(locale)' if $CAN_DECODE;
 
     for my $chunk (@{$self->{RESULT}}) {
+        my $to_write = "$chunk\n";
+        if (!$CAN_DECODE && $] > 5.008) {
+            utf8::encode $to_write;
+        }
         print $fh "$chunk\n"
             or die "Can't write to MakeMaker.tmp: $!";
     }
@@ -1242,28 +1257,62 @@ sub neatvalue {
         push @m, "]";
         return join "", @m;
     }
-    return "$v" unless $t eq 'HASH';
+    return $v unless $t eq 'HASH';
     my(@m, $key, $val);
-    while (($key,$val) = each %$v){
+    for my $key (sort keys %$v) {
         last unless defined $key; # cautious programming in case (undef,undef) is true
-        push(@m,"$key=>".neatvalue($val)) ;
+        push @m,"$key=>".neatvalue($v->{$key});
     }
     return "{ ".join(', ',@m)." }";
 }
 
+sub _find_magic_vstring {
+    my $value = shift;
+    return $value if $UNDER_CORE;
+    my $tvalue = '';
+    require B;
+    my $sv = B::svref_2object(\$value);
+    my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
+    while ( $magic ) {
+        if ( $magic->TYPE eq 'V' ) {
+            $tvalue = $magic->PTR;
+            $tvalue =~ s/^v?(.+)$/v$1/;
+            last;
+        }
+        else {
+            $magic = $magic->MOREMAGIC;
+        }
+    }
+    return $tvalue;
+}
+
+
 # Look for weird version numbers, warn about them and set them to 0
 # before CPAN::Meta chokes.
 sub clean_versions {
     my($self, $key) = @_;
-
     my $reqs = $self->{$key};
     for my $module (keys %$reqs) {
-        my $version = $reqs->{$module};
-
-        if( !defined $version or $version !~ /^v?[\d_\.]+$/ ) {
-            carp "Unparsable version '$version' for prerequisite $module";
+        my $v = $reqs->{$module};
+        my $printable = _find_magic_vstring($v);
+        $v = $printable if length $printable;
+        my $version = eval {
+            local $SIG{__WARN__} = sub {
+              # simulate "use warnings FATAL => 'all'" for vintage perls
+              die @_;
+            };
+            version->new($v)->stringify;
+        };
+        if( $@ || $reqs->{$module} eq '' ) {
+            if ( $] < 5.008 && $v !~ /^v?[\d_\.]+$/ ) {
+               $v = sprintf "v%vd", $v unless $v eq '';
+            }
+            carp "Unparsable version '$v' for prerequisite $module";
             $reqs->{$module} = 0;
         }
+        else {
+            $reqs->{$module} = $version;
+        }
     }
 }
 
@@ -1318,15 +1367,19 @@ won't have to face the possibly bewildering errors resulting from
 using the wrong one.
 
 On POSIX systems, that program will likely be GNU Make; on Microsoft
-Windows, it will be either Microsoft NMake or DMake. Note that this
-module does not support generating Makefiles for GNU Make on Windows.
+Windows, it will be either Microsoft NMake, DMake or GNU Make.
 See the section on the L</"MAKE"> parameter for details.
 
-MakeMaker is object oriented. Each directory below the current
+ExtUtils::MakeMaker (EUMM) is object oriented. Each directory below the current
 directory that contains a Makefile.PL is treated as a separate
 object. This makes it possible to write an unlimited number of
 Makefiles with a single invocation of WriteMakefile().
 
+All inputs to WriteMakefile are Unicode characters, not just octets. EUMM
+seeks to handle all of these correctly. It is currently still not possible
+to portably use Unicode characters in module names, because this requires
+Perl to handle Unicode filenames, which is not yet the case on Windows.
+
 =head2 How To Write A Makefile.PL
 
 See L<ExtUtils::MakeMaker::Tutorial>.
@@ -1375,6 +1428,11 @@ It is possible to use globbing with this mechanism.
 
   make test TEST_FILES='t/foobar.t t/dagobah*.t'
 
+Windows users who are using C<nmake> should note that due to a bug in C<nmake>,
+when specifying C<TEST_FILES> you must use back-slashes instead of forward-slashes.
+
+  nmake test TEST_FILES='t\foobar.t t\dagobah*.t'
+
 =head2 make testdb
 
 A useful variation of the above is the target C<testdb>. It runs the
@@ -2195,6 +2253,20 @@ own.  META_MERGE will merge its value with the default.
 Unless you want to override the defaults, prefer META_MERGE so as to
 get the advantage of any future defaults.
 
+Where prereqs are concerned, if META_MERGE is used, prerequisites are merged
+with their counterpart C<WriteMakefile()> argument
+(PREREQ_PM is merged into {prereqs}{runtime}{requires},
+BUILD_REQUIRES into C<{prereqs}{build}{requires}>,
+CONFIGURE_REQUIRES into C<{prereqs}{configure}{requires}>,
+and TEST_REQUIRES into C<{prereqs}{test}{requires})>.
+When prereqs are specified with META_ADD, the only prerequisites added to the
+file come from the metadata, not C<WriteMakefile()> arguments.
+
+Note that these configuration options are only used for generating F<META.yml>
+and F<META.json> -- they are NOT used for F<MYMETA.yml> and F<MYMETA.json>.
+Therefore data in these fields should NOT be used for dynamic (user-side)
+configuration.
+
 By default CPAN Meta specification C<1.4> is used. In order to use
 CPAN Meta specification C<2.0>, indicate with C<meta-spec> the version
 you want to use.
@@ -2232,9 +2304,9 @@ name of the library (see SDBM_File)
 
 The package representing the distribution. For example, C<Test::More>
 or C<ExtUtils::MakeMaker>. It will be used to derive information about
-the distribution such as the L<DISTNAME>, installation locations
+the distribution such as the L</DISTNAME>, installation locations
 within the Perl library and where XS files will be looked for by
-default (see L<XS>).
+default (see L</XS>).
 
 C<NAME> I<must> be a valid Perl package name and it I<must> have an
 associated C<.pm> file. For example, C<Foo::Bar> is a valid C<NAME>
@@ -3092,6 +3164,12 @@ If no $default is provided an empty string will be used instead.
 
 =back
 
+=head2 Supported versions of Perl
+
+Please note that while this module works on Perl 5.6, it is no longer
+being routinely tested on 5.6 - the earliest Perl version being routinely
+tested, and expressly supported, is 5.8.1. However, patches to repair
+any breakage on 5.6 are still being accepted.
 
 =head1 ENVIRONMENT
 
@@ -3130,6 +3208,13 @@ help you setup your distribution.
 
 L<CPAN::Meta> and L<CPAN::Meta::Spec> explain CPAN Meta files in detail.
 
+L<File::ShareDir::Install> makes it easy to install static, sometimes
+also referred to as 'shared' files. L<File::ShareDir> helps accessing
+the shared files after installation.
+
+L<Dist::Zilla> makes it easy for the module author to create MakeMaker-based
+distributions with lots of bells and whistles.
+
 =head1 AUTHORS
 
 Andy Dougherty C<doughera@lafayette.edu>, Andreas KE<ouml>nig
@@ -3,7 +3,7 @@ package ExtUtils::Mkbootstrap;
 # There's just too much Dynaloader incest here to turn on strict vars.
 use strict 'refs';
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 require Exporter;
 our @ISA = ('Exporter');
@@ -10,7 +10,7 @@ use Config;
 
 our @ISA = qw(Exporter);
 our @EXPORT = qw(&Mksymlists);
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 sub Mksymlists {
     my(%spec) = @_;
@@ -141,19 +141,24 @@ sub _write_win32 {
     print $def "EXPORTS\n  ";
     my @syms;
     # Export public symbols both with and without underscores to
-    # ensure compatibility between DLLs from different compilers
+    # ensure compatibility between DLLs from Borland C and Visual C
     # NOTE: DynaLoader itself only uses the names without underscores,
     # so this is only to cover the case when the extension DLL may be
     # linked to directly from C. GSAR 97-07-10
-    if ($Config::Config{'cc'} =~ /^bcc/i) {
-        for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
-            push @syms, "_$_", "$_ = _$_";
+
+    #bcc dropped in 5.16, so dont create useless extra symbols for export table
+    unless($] >= 5.016) {
+        if ($Config::Config{'cc'} =~ /^bcc/i) {
+            push @syms, "_$_", "$_ = _$_"
+                for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}});
         }
-    }
-    else {
-        for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) {
-            push @syms, "$_", "_$_ = $_";
+        else {
+            push @syms, "$_", "_$_ = $_"
+                for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}});
         }
+    } else {
+        push @syms, "$_"
+            for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}});
     }
     print $def join("\n  ",@syms, "\n") if @syms;
     _print_imports($def, $data);
@@ -3,7 +3,7 @@ package ExtUtils::testlib;
 use strict;
 use warnings;
 
-our $VERSION = '6.98';
+our $VERSION = '7.02';
 
 use Cwd;
 use File::Spec;
@@ -44,20 +44,10 @@ my %special_dist = (
         print "Using included version of Scalar::Util ($inc_version) because it is not already installed.\n";
         return 1;
     },
-    "version" => sub {
-        # Special case for version, never override the XS version with a
-        # pure Perl version.  Just check that it's there.
-        my $installed = find_installed("version.pm");
-        if ( $] == 5.010000 ) {
-          # Special special case
-          my $installed_version = $installed ? MM->parse_version( $installed ) : 0;
-          return should_use_dist('version') if $installed_version < 0.77;
-        }
-        return if $installed;
-
-        my $inc_version = MM->parse_version("$bundle_dir/version/version.pm");
-        print "Using included version of version ($inc_version) because it is not already installed.\n";
-        return 1;
+    "json-pp-compat5006" => sub {
+        # Only required by JSON::PP on perls < 5.008
+        return unless $] < 5.008;
+        &should_use_dist;
     },
 );
 
@@ -94,8 +84,7 @@ sub copy_bundles {
 
         # Don't require it unless we need it, allowing vendors to just delete
         # the contents of bundle/
-        require File::Copy::Recursive;
-        File::Copy::Recursive::rcopy_glob("$src/$dist/*", $dest) or
+        my::bundles::Copy::Recursive::rcopy_glob("$src/$dist/*", $dest) or
           die "Can't copy $src/$dist/* to $dest";
     }
 }
@@ -157,3 +146,695 @@ sub cleanup_version {
 }
 
 1;
+
+package my::bundles::Copy::Recursive;
+
+use strict;
+BEGIN {
+    # Keep older versions of Perl from trying to use lexical warnings
+    $INC{'warnings.pm'} = "fake warnings entry for < 5.6 perl ($])" if $] < 5.006;
+}
+use warnings;
+
+use Carp;
+use File::Copy;
+use File::Spec; #not really needed because File::Copy already gets it, but for good measure :)
+
+use vars qw(
+    @ISA      @EXPORT_OK $VERSION  $MaxDepth $KeepMode $CPRFComp $CopyLink
+    $PFSCheck $RemvBase $NoFtlPth  $ForcePth $CopyLoop $RMTrgFil $RMTrgDir 
+    $CondCopy $BdTrgWrn $SkipFlop  $DirPerms
+);
+
+$MaxDepth = 0;
+$KeepMode = 1;
+$CPRFComp = 0; 
+$CopyLink = eval { local $SIG{'__DIE__'};symlink '',''; 1 } || 0;
+$PFSCheck = 1;
+$RemvBase = 0;
+$NoFtlPth = 0;
+$ForcePth = 0;
+$CopyLoop = 0;
+$RMTrgFil = 0;
+$RMTrgDir = 0;
+$CondCopy = {};
+$BdTrgWrn = 0;
+$SkipFlop = 0;
+$DirPerms = 0777; 
+
+my $samecheck = sub {
+   return 1 if $^O eq 'MSWin32'; # need better way to check for this on winders...
+   return if @_ != 2 || !defined $_[0] || !defined $_[1];
+   return if $_[0] eq $_[1];
+
+   my $one = '';
+   if($PFSCheck) {
+      $one    = join( '-', ( stat $_[0] )[0,1] ) || '';
+      my $two = join( '-', ( stat $_[1] )[0,1] ) || '';
+      if ( $one eq $two && $one ) {
+          carp "$_[0] and $_[1] are identical";
+          return;
+      }
+   }
+
+   if(-d $_[0] && !$CopyLoop) {
+      $one    = join( '-', ( stat $_[0] )[0,1] ) if !$one;
+      my $abs = File::Spec->rel2abs($_[1]);
+      my @pth = File::Spec->splitdir( $abs );
+      while(@pth) {
+         my $cur = File::Spec->catdir(@pth);
+         last if !$cur; # probably not necessary, but nice to have just in case :)
+         my $two = join( '-', ( stat $cur )[0,1] ) || '';
+         if ( $one eq $two && $one ) {
+             # $! = 62; # Too many levels of symbolic links
+             carp "Caught Deep Recursion Condition: $_[0] contains $_[1]";
+             return;
+         }
+      
+         pop @pth;
+      }
+   }
+
+   return 1;
+};
+
+my $glob = sub {
+    my ($do, $src_glob, @args) = @_;
+    
+    local $CPRFComp = 1;
+    
+    my @rt;
+    for my $path ( glob($src_glob) ) {
+        my @call = [$do->($path, @args)] or return;
+        push @rt, \@call;
+    }
+    
+    return @rt;
+};
+
+my $move = sub {
+   my $fl = shift;
+   my @x;
+   if($fl) {
+      @x = fcopy(@_) or return;
+   } else {
+      @x = dircopy(@_) or return;
+   }
+   if(@x) {
+      if($fl) {
+         unlink $_[0] or return;
+      } else {
+         pathrmdir($_[0]) or return;
+      }
+      if($RemvBase) {
+         my ($volm, $path) = File::Spec->splitpath($_[0]);
+         pathrm(File::Spec->catpath($volm,$path,''), $ForcePth, $NoFtlPth) or return;
+      }
+   }
+  return wantarray ? @x : $x[0];
+};
+
+my $ok_todo_asper_condcopy = sub {
+    my $org = shift;
+    my $copy = 1;
+    if(exists $CondCopy->{$org}) {
+        if($CondCopy->{$org}{'md5'}) {
+
+        }
+        if($copy) {
+
+        }
+    }
+    return $copy;
+};
+
+sub fcopy { 
+   $samecheck->(@_) or return;
+   if($RMTrgFil && (-d $_[1] || -e $_[1]) ) {
+      my $trg = $_[1];
+      if( -d $trg ) {
+        my @trgx = File::Spec->splitpath( $_[0] );
+        $trg = File::Spec->catfile( $_[1], $trgx[ $#trgx ] );
+      }
+      $samecheck->($_[0], $trg) or return;
+      if(-e $trg) {
+         if($RMTrgFil == 1) {
+            unlink $trg or carp "\$RMTrgFil failed: $!";
+         } else {
+            unlink $trg or return;
+         }
+      }
+   }
+   my ($volm, $path) = File::Spec->splitpath($_[1]);
+   if($path && !-d $path) {
+      pathmk(File::Spec->catpath($volm,$path,''), $NoFtlPth);
+   }
+   if( -l $_[0] && $CopyLink ) {
+      carp "Copying a symlink ($_[0]) whose target does not exist" 
+          if !-e readlink($_[0]) && $BdTrgWrn;
+      symlink readlink(shift()), shift() or return;
+   } else {  
+      copy(@_) or return;
+
+      my @base_file = File::Spec->splitpath($_[0]);
+      my $mode_trg = -d $_[1] ? File::Spec->catfile($_[1], $base_file[ $#base_file ]) : $_[1];
+
+      chmod scalar((stat($_[0]))[2]), $mode_trg if $KeepMode;
+   }
+   return wantarray ? (1,0,0) : 1; # use 0's incase they do math on them and in case rcopy() is called in list context = no uninit val warnings
+}
+
+sub rcopy { 
+    if (-l $_[0] && $CopyLink) {
+        goto &fcopy;    
+    }
+    
+    goto &dircopy if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
+    goto &fcopy;
+}
+
+sub rcopy_glob {
+    $glob->(\&rcopy, @_);
+}
+
+sub dircopy {
+   if($RMTrgDir && -d $_[1]) {
+      if($RMTrgDir == 1) {
+         pathrmdir($_[1]) or carp "\$RMTrgDir failed: $!";
+      } else {
+         pathrmdir($_[1]) or return;
+      }
+   }
+   my $globstar = 0;
+   my $_zero = $_[0];
+   my $_one = $_[1];
+   if ( substr( $_zero, ( 1 * -1 ), 1 ) eq '*') {
+       $globstar = 1;
+       $_zero = substr( $_zero, 0, ( length( $_zero ) - 1 ) );
+   }
+
+   $samecheck->(  $_zero, $_[1] ) or return;
+   if ( !-d $_zero || ( -e $_[1] && !-d $_[1] ) ) {
+       $! = 20; 
+       return;
+   } 
+
+   if(!-d $_[1]) {
+      pathmk($_[1], $NoFtlPth) or return;
+   } else {
+      if($CPRFComp && !$globstar) {
+         my @parts = File::Spec->splitdir($_zero);
+         while($parts[ $#parts ] eq '') { pop @parts; }
+         $_one = File::Spec->catdir($_[1], $parts[$#parts]);
+      }
+   }
+   my $baseend = $_one;
+   my $level   = 0;
+   my $filen   = 0;
+   my $dirn    = 0;
+
+   my $recurs; #must be my()ed before sub {} since it calls itself
+   $recurs =  sub {
+      my ($str,$end,$buf) = @_;
+      $filen++ if $end eq $baseend; 
+      $dirn++ if $end eq $baseend;
+      
+      $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
+      mkdir($end,$DirPerms) or return if !-d $end;
+      chmod scalar((stat($str))[2]), $end if $KeepMode;
+      if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) {
+         return ($filen,$dirn,$level) if wantarray;
+         return $filen;
+      }
+      $level++;
+
+      
+      my @files;
+      if ( $] < 5.006 ) {
+          opendir(STR_DH, $str) or return;
+          @files = grep( $_ ne '.' && $_ ne '..', readdir(STR_DH));
+          closedir STR_DH;
+      }
+      else {
+          opendir(my $str_dh, $str) or return;
+          @files = grep( $_ ne '.' && $_ ne '..', readdir($str_dh));
+          closedir $str_dh;
+      }
+
+      for my $file (@files) {
+          my ($file_ut) = $file =~ m{ (.*) }xms;
+          my $org = File::Spec->catfile($str, $file_ut);
+          my $new = File::Spec->catfile($end, $file_ut);
+          if( -l $org && $CopyLink ) {
+              carp "Copying a symlink ($org) whose target does not exist" 
+                  if !-e readlink($org) && $BdTrgWrn;
+              symlink readlink($org), $new or return;
+          } 
+          elsif(-d $org) {
+              $recurs->($org,$new,$buf) if defined $buf;
+              $recurs->($org,$new) if !defined $buf;
+              $filen++;
+              $dirn++;
+          } 
+          else {
+              if($ok_todo_asper_condcopy->($org)) {
+                  if($SkipFlop) {
+                      fcopy($org,$new,$buf) or next if defined $buf;
+                      fcopy($org,$new) or next if !defined $buf;                      
+                  }
+                  else {
+                      fcopy($org,$new,$buf) or return if defined $buf;
+                      fcopy($org,$new) or return if !defined $buf;
+                  }
+                  chmod scalar((stat($org))[2]), $new if $KeepMode;
+                  $filen++;
+              }
+          }
+      }
+      1;
+   };
+
+   $recurs->($_zero, $_one, $_[2]) or return;
+   return wantarray ? ($filen,$dirn,$level) : $filen;
+}
+
+sub fmove { $move->(1, @_) } 
+
+sub rmove { 
+    if (-l $_[0] && $CopyLink) {
+        goto &fmove;    
+    }
+    
+    goto &dirmove if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
+    goto &fmove;
+}
+
+sub rmove_glob {
+    $glob->(\&rmove, @_);
+}
+
+sub dirmove { $move->(0, @_) }
+
+sub pathmk {
+   my @parts = File::Spec->splitdir( shift() );
+   my $nofatal = shift;
+   my $pth = $parts[0];
+   my $zer = 0;
+   if(!$pth) {
+      $pth = File::Spec->catdir($parts[0],$parts[1]);
+      $zer = 1;
+   }
+   for($zer..$#parts) {
+      $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
+      mkdir($pth,$DirPerms) or return if !-d $pth && !$nofatal;
+      mkdir($pth,$DirPerms) if !-d $pth && $nofatal;
+      $pth = File::Spec->catdir($pth, $parts[$_ + 1]) unless $_ == $#parts;
+   }
+   1;
+} 
+
+sub pathempty {
+   my $pth = shift; 
+
+   return 2 if !-d $pth;
+
+   my @names;
+   my $pth_dh;
+   if ( $] < 5.006 ) {
+       opendir(PTH_DH, $pth) or return;
+       @names = grep !/^\.+$/, readdir(PTH_DH);
+   }
+   else {
+       opendir($pth_dh, $pth) or return;
+       @names = grep !/^\.+$/, readdir($pth_dh);       
+   }
+   
+   for my $name (@names) {
+      my ($name_ut) = $name =~ m{ (.*) }xms;
+      my $flpth     = File::Spec->catdir($pth, $name_ut);
+
+      if( -l $flpth ) {
+	      unlink $flpth or return; 
+      }
+      elsif(-d $flpth) {
+          pathrmdir($flpth) or return;
+      } 
+      else {
+          unlink $flpth or return;
+      }
+   }
+
+   if ( $] < 5.006 ) {
+       closedir PTH_DH;
+   }
+   else {
+       closedir $pth_dh;
+   }
+   
+   1;
+}
+
+sub pathrm {
+   my $path = shift;
+   return 2 if !-d $path;
+   my @pth = File::Spec->splitdir( $path );
+   my $force = shift;
+
+   while(@pth) { 
+      my $cur = File::Spec->catdir(@pth);
+      last if !$cur; # necessary ??? 
+      if(!shift()) {
+         pathempty($cur) or return if $force;
+         rmdir $cur or return;
+      } 
+      else {
+         pathempty($cur) if $force;
+         rmdir $cur;
+      }
+      pop @pth;
+   }
+   1;
+}
+
+sub pathrmdir {
+    my $dir = shift;
+    if( -e $dir ) {
+        return if !-d $dir;
+    }
+    else {
+        return 2;
+    }
+
+    pathempty($dir) or return;
+    
+    rmdir $dir or return;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+File::Copy::Recursive - Perl extension for recursively copying files and directories
+
+=head1 SYNOPSIS
+
+  use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove);
+
+  fcopy($orig,$new[,$buf]) or die $!;
+  rcopy($orig,$new[,$buf]) or die $!;
+  dircopy($orig,$new[,$buf]) or die $!;
+
+  fmove($orig,$new[,$buf]) or die $!;
+  rmove($orig,$new[,$buf]) or die $!;
+  dirmove($orig,$new[,$buf]) or die $!;
+  
+  rcopy_glob("orig/stuff-*", $trg [, $buf]) or die $!;
+  rmove_glob("orig/stuff-*", $trg [,$buf]) or die $!;
+
+=head1 DESCRIPTION
+
+This module copies and moves directories recursively (or single files, well... singley) to an optional depth and attempts to preserve each file or directory's mode.
+
+=head1 EXPORT
+
+None by default. But you can export all the functions as in the example above and the path* functions if you wish.
+
+=head2 fcopy()
+
+This function uses File::Copy's copy() function to copy a file but not a directory. Any directories are recursively created if need be.
+One difference to File::Copy::copy() is that fcopy attempts to preserve the mode (see Preserving Mode below)
+The optional $buf in the synopsis if the same as File::Copy::copy()'s 3rd argument
+returns the same as File::Copy::copy() in scalar context and 1,0,0 in list context to accomidate rcopy()'s list context on regular files. (See below for more info)
+
+=head2 dircopy()
+
+This function recursively traverses the $orig directory's structure and recursively copies it to the $new directory.
+$new is created if necessary (multiple non existant directories is ok (IE foo/bar/baz). The script logically and portably creates all of them if necessary).
+It attempts to preserve the mode (see Preserving Mode below) and 
+by default it copies all the way down into the directory, (see Managing Depth) below.
+If a directory is not specified it croaks just like fcopy croaks if its not a file that is specified.
+
+returns true or false, for true in scalar context it returns the number of files and directories copied,
+In list context it returns the number of files and directories, number of directories only, depth level traversed.
+
+  my $num_of_files_and_dirs = dircopy($orig,$new);
+  my($num_of_files_and_dirs,$num_of_dirs,$depth_traversed) = dircopy($orig,$new);
+  
+Normally it stops and return's if a copy fails, to continue on regardless set $File::Copy::Recursive::SkipFlop to true.
+
+    local $File::Copy::Recursive::SkipFlop = 1;
+
+That way it will copy everythgingit can ina directory and won't stop because of permissions, etc...
+
+=head2 rcopy()
+
+This function will allow you to specify a file *or* directory. It calls fcopy() if its a file and dircopy() if its a directory.
+If you call rcopy() (or fcopy() for that matter) on a file in list context, the values will be 1,0,0 since no directories and no depth are used. 
+This is important becasue if its a directory in list context and there is only the initial directory the return value is 1,1,1.
+
+=head2 rcopy_glob()
+
+This function lets you specify a pattern suitable for perl's glob() as the first argument. Subsequently each path returned by perl's glob() gets rcopy()ied.
+
+It returns and array whose items are array refs that contain the return value of each rcopy() call.
+
+It forces behavior as if $File::Copy::Recursive::CPRFComp is true.
+
+=head2 fmove()
+
+Copies the file then removes the original. You can manage the path the original file is in according to $RemvBase.
+
+=head2 dirmove()
+
+Uses dircopy() to copy the directory then removes the original. You can manage the path the original directory is in according to $RemvBase.
+
+=head2 rmove()
+
+Like rcopy() but calls fmove() or dirmove() instead.
+
+=head2 rmove_glob()
+
+Like rcopy_glob() but calls rmove() instead of rcopy()
+
+=head3 $RemvBase
+
+Default is false. When set to true the *move() functions will not only attempt to remove the original file or directory but will remove the given path it is in.
+
+So if you:
+
+   rmove('foo/bar/baz', '/etc/');
+   # "baz" is removed from foo/bar after it is successfully copied to /etc/
+   
+   local $File::Copy::Recursive::Remvbase = 1;
+   rmove('foo/bar/baz','/etc/');
+   # if baz is successfully copied to /etc/ :
+   # first "baz" is removed from foo/bar
+   # then "foo/bar is removed via pathrm()
+
+=head4 $ForcePth
+
+Default is false. When set to true it calls pathempty() before any directories are removed to empty the directory so it can be rmdir()'ed when $RemvBase is in effect.
+
+=head2 Creating and Removing Paths
+
+=head3 $NoFtlPth
+
+Default is false. If set to true  rmdir(), mkdir(), and pathempty() calls in pathrm() and pathmk() do not return() on failure.
+
+If its set to true they just silently go about their business regardless. This isn't a good idea but its there if you want it.
+
+=head3 $DirPerms
+
+Mode to pass to any mkdir() calls. Defaults to 0777 as per umask()'s POD. Explicitly having this allows older perls to be able to use FCR and might add a bit of flexibility for you.
+
+Any value you set it to should be suitable for oct()
+
+=head3 Path functions
+
+These functions exist soley because they were necessary for the move and copy functions to have the features they do and not because they are of themselves the purpose of this module. That being said, here is how they work so you can understand how the copy and move funtions work and use them by themselves if you wish.
+
+=head4 pathrm()
+
+Removes a given path recursively. It removes the *entire* path so be carefull!!!
+
+Returns 2 if the given path is not a directory.
+
+  File::Copy::Recursive::pathrm('foo/bar/baz') or die $!;
+  # foo no longer exists
+
+Same as:
+
+  rmdir 'foo/bar/baz' or die $!;
+  rmdir 'foo/bar' or die $!;
+  rmdir 'foo' or die $!;
+
+An optional second argument makes it call pathempty() before any rmdir()'s when set to true.
+
+  File::Copy::Recursive::pathrm('foo/bar/baz', 1) or die $!;
+  # foo no longer exists
+
+Same as:PFSCheck
+
+  File::Copy::Recursive::pathempty('foo/bar/baz') or die $!;
+  rmdir 'foo/bar/baz' or die $!;
+  File::Copy::Recursive::pathempty('foo/bar/') or die $!;
+  rmdir 'foo/bar' or die $!;
+  File::Copy::Recursive::pathempty('foo/') or die $!;
+  rmdir 'foo' or die $!;
+
+An optional third argument acts like $File::Copy::Recursive::NoFtlPth, again probably not a good idea.
+
+=head4 pathempty()
+
+Recursively removes the given directory's contents so it is empty. returns 2 if argument is not a directory, 1 on successfully emptying the directory.
+
+   File::Copy::Recursive::pathempty($pth) or die $!;
+   # $pth is now an empty directory
+
+=head4 pathmk()
+
+Creates a given path recursively. Creates foo/bar/baz even if foo does not exist.
+
+   File::Copy::Recursive::pathmk('foo/bar/baz') or die $!;
+
+An optional second argument if true acts just like $File::Copy::Recursive::NoFtlPth, which means you'd never get your die() if something went wrong. Again, probably a *bad* idea.
+
+=head4 pathrmdir()
+
+Same as rmdir() but it calls pathempty() first to recursively empty it first since rmdir can not remove a directory with contents.
+Just removes the top directory the path given instead of the entire path like pathrm(). Return 2 if given argument does not exist (IE its already gone). Return false if it exists but is not a directory.
+
+=head2 Preserving Mode
+
+By default a quiet attempt is made to change the new file or directory to the mode of the old one.
+To turn this behavior off set
+  $File::Copy::Recursive::KeepMode
+to false;
+
+=head2 Managing Depth
+
+You can set the maximum depth a directory structure is recursed by setting:
+  $File::Copy::Recursive::MaxDepth 
+to a whole number greater than 0.
+
+=head2 SymLinks
+
+If your system supports symlinks then symlinks will be copied as symlinks instead of as the target file.
+Perl's symlink() is used instead of File::Copy's copy()
+You can customize this behavior by setting $File::Copy::Recursive::CopyLink to a true or false value.
+It is already set to true or false dending on your system's support of symlinks so you can check it with an if statement to see how it will behave:
+
+    if($File::Copy::Recursive::CopyLink) {
+        print "Symlinks will be preserved\n";
+    } else {
+        print "Symlinks will not be preserved because your system does not support it\n";
+    }
+
+If symlinks are being copied you can set $File::Copy::Recursive::BdTrgWrn to true to make it carp when it copies a link whose target does not exist. Its false by default.
+
+    local $File::Copy::Recursive::BdTrgWrn  = 1;
+
+=head2 Removing existing target file or directory before copying.
+
+This can be done by setting $File::Copy::Recursive::RMTrgFil or $File::Copy::Recursive::RMTrgDir for file or directory behavior respectively.
+
+0 = off (This is the default)
+
+1 = carp() $! if removal fails
+
+2 = return if removal fails
+
+    local $File::Copy::Recursive::RMTrgFil = 1;
+    fcopy($orig, $target) or die $!;
+    # if it fails it does warn() and keeps going
+
+    local $File::Copy::Recursive::RMTrgDir = 2;
+    dircopy($orig, $target) or die $!;
+    # if it fails it does your "or die"
+
+This should be unnecessary most of the time but its there if you need it :)
+
+=head2 Turning off stat() check
+
+By default the files or directories are checked to see if they are the same (IE linked, or two paths (absolute/relative or different relative paths) to the same file) by comparing the file's stat() info. 
+It's a very efficient check that croaks if they are and shouldn't be turned off but if you must for some weird reason just set $File::Copy::Recursive::PFSCheck to a false value. ("PFS" stands for "Physical File System")
+
+=head2 Emulating cp -rf dir1/ dir2/
+
+By default dircopy($dir1,$dir2) will put $dir1's contents right into $dir2 whether $dir2 exists or not.
+
+You can make dircopy() emulate cp -rf by setting $File::Copy::Recursive::CPRFComp to true.
+
+NOTE: This only emulates -f in the sense that it does not prompt. It does not remove the target file or directory if it exists.
+If you need to do that then use the variables $RMTrgFil and $RMTrgDir described in "Removing existing target file or directory before copying" above.
+
+That means that if $dir2 exists it puts the contents into $dir2/$dir1 instead of $dir2 just like cp -rf.
+If $dir2 does not exist then the contents go into $dir2 like normal (also like cp -rf)
+
+So assuming 'foo/file':
+
+    dircopy('foo', 'bar') or die $!;
+    # if bar does not exist the result is bar/file
+    # if bar does exist the result is bar/file
+
+    $File::Copy::Recursive::CPRFComp = 1;
+    dircopy('foo', 'bar') or die $!;
+    # if bar does not exist the result is bar/file
+    # if bar does exist the result is bar/foo/file
+
+You can also specify a star for cp -rf glob type behavior:
+
+    dircopy('foo/*', 'bar') or die $!;
+    # if bar does not exist the result is bar/file
+    # if bar does exist the result is bar/file
+
+    $File::Copy::Recursive::CPRFComp = 1;
+    dircopy('foo/*', 'bar') or die $!;
+    # if bar does not exist the result is bar/file
+    # if bar does exist the result is bar/file
+
+NOTE: The '*' is only like cp -rf foo/* and *DOES NOT EXPAND PARTIAL DIRECTORY NAMES LIKE YOUR SHELL DOES* (IE not like cp -rf fo* to copy foo/*)
+
+=head2 Allowing Copy Loops
+
+If you want to allow:
+
+  cp -rf . foo/
+
+type behavior set $File::Copy::Recursive::CopyLoop to true.
+
+This is false by default so that a check is done to see if the source directory will contain the target directory and croaks to avoid this problem.
+
+If you ever find a situation where $CopyLoop = 1 is desirable let me know (IE its a bad bad idea but is there if you want it)
+
+(Note: On Windows this was necessary since it uses stat() to detemine samedness and stat() is essencially useless for this on Windows. 
+The test is now simply skipped on Windows but I'd rather have an actual reliable check if anyone in Microsoft land would care to share)
+
+=head1 SEE ALSO
+
+L<File::Copy> L<File::Spec>
+
+=head1 TO DO
+
+I am currently working on and reviewing some other modules to use in the new interface so we can lose the horrid globals as well as some other undesirable traits and also more easily make available some long standing requests.
+
+Tests will be easier to do with the new interface and hence the testing focus will shift to the new interface and aim to be comprehensive.
+
+The old interface will work, it just won't be brought in until it is used, so it will add no overhead for users of the new interface.
+
+I'll add this after the latest verision has been out for a while with no new features or issues found :)
+
+=head1 AUTHOR
+
+Daniel Muey, L<http://drmuey.com/cpan_contact.pl>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2004 by Daniel Muey
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself. 
+
+=cut
@@ -21,7 +21,7 @@ perl_lib();
 
 ok( setup_recurs(), 'setup' );
 END {
-    ok( chdir File::Spec->updir );
+    ok( chdir File::Spec->updir, 'chdir updir' );
     ok( teardown_recurs(), 'teardown' );
 }
 
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# Tests INSTALL_BASE
+# Tests INSTALL_BASE to a directory without AND with a space in the name
 
 BEGIN {
     unshift @INC, 't/lib';
@@ -9,72 +9,81 @@ BEGIN {
 use strict;
 use File::Path;
 use Config;
+my @INSTDIRS = ('../dummy-install', '../dummy  install');
+my $CLEANUP = 1;
+$CLEANUP &&= 1; # so always 1 or numerically 0
 
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 20);
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
+use Test::More;
+use Config;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 3 + $CLEANUP + @INSTDIRS * (15 + $CLEANUP));
 
 my $Is_VMS = $^O eq 'VMS';
 
 my $perl = which_perl();
 
 use File::Temp qw[tempdir];
-my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 );
+my $tmpdir = tempdir( DIR => 't', CLEANUP => $CLEANUP );
 chdir $tmpdir;
 
 perl_lib;
 
 ok( setup_recurs(), 'setup' );
 END {
-    ok( chdir File::Spec->updir );
-    ok( teardown_recurs(), 'teardown' );
+    ok( chdir File::Spec->updir, 'chdir updir' );
+    ok( teardown_recurs(), 'teardown' ) if $CLEANUP;
+    map { rmtree $_ } @INSTDIRS if $CLEANUP;
 }
 
 ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy") || diag("chdir failed; $!");
 
-my @mpl_out = run(qq{$perl Makefile.PL "INSTALL_BASE=../dummy-install"});
-END { rmtree '../dummy-install'; }
+for my $instdir (@INSTDIRS) {
+  my @mpl_out = run(qq{$perl Makefile.PL "INSTALL_BASE=$instdir"});
 
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
-  diag(@mpl_out);
+  cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
+    diag(@mpl_out);
 
-my $makefile = makefile_name();
-ok( grep(/^Writing $makefile for Big::Dummy/,
-         @mpl_out) == 1,
-                                           'Makefile.PL output looks right');
+  my $makefile = makefile_name();
+  ok( grep(/^Writing $makefile for Big::Dummy/,
+	   @mpl_out) == 1,
+					     'Makefile.PL output looks right');
 
-my $make = make_run();
-run("$make");   # this is necessary due to a dmake bug.
-my $install_out = run("$make install");
-is( $?, 0, '  make install exited normally' ) || diag $install_out;
-like( $install_out, qr/^Installing /m );
+  my $make = make_run();
+  run("$make");   # this is necessary due to a dmake bug.
+  my $install_out = run("$make install");
+  is( $?, 0, '  make install exited normally' ) || diag $install_out;
+  like( $install_out, qr/^Installing /m, '"Installing" in output' );
 
-ok( -r '../dummy-install',      '  install dir created' );
+  ok( -r $instdir,      '  install dir created' );
 
-my @installed_files =
-  ('../dummy-install/lib/perl5/Big/Dummy.pm',
-   '../dummy-install/lib/perl5/Big/Liar.pm',
-   '../dummy-install/bin/program',
-   "../dummy-install/lib/perl5/$Config{archname}/perllocal.pod",
-   "../dummy-install/lib/perl5/$Config{archname}/auto/Big/Dummy/.packlist"
-  );
+  my @installed_files =
+    ("$instdir/lib/perl5/Big/Dummy.pm",
+     "$instdir/lib/perl5/Big/Liar.pm",
+     "$instdir/bin/program",
+     "$instdir/lib/perl5/$Config{archname}/perllocal.pod",
+     "$instdir/lib/perl5/$Config{archname}/auto/Big/Dummy/.packlist"
+    );
 
-foreach my $file (@installed_files) {
-    ok( -e $file, "  $file installed" );
-    ok( -r $file, "  $file readable" );
-}
+  foreach my $file (@installed_files) {
+      ok( -e $file, "  $file installed" );
+      ok( -r $file, "  $file readable" );
+  }
 
 
-# nmake outputs its damned logo
-# Send STDERR off to oblivion.
-open(SAVERR, ">&STDERR") or die $!;
-open(STDERR, ">".File::Spec->devnull) or die $!;
+  # nmake outputs its damned logo
+  # Send STDERR off to oblivion.
+  open(SAVERR, ">&STDERR") or die $!;
+  open(STDERR, ">".File::Spec->devnull) or die $!;
 
-my $realclean_out = run("$make realclean");
-is( $?, 0, 'realclean' ) || diag($realclean_out);
+  if ($CLEANUP) {
+      my $realclean_out = run("$make realclean");
+      is( $?, 0, 'realclean' ) || diag($realclean_out);
+  }
 
-open(STDERR, ">&SAVERR") or die $!;
-close SAVERR;
+  open(STDERR, ">&SAVERR") or die $!;
+  close SAVERR;
+}
@@ -26,14 +26,10 @@ exit;
 
 sub run {
     use_ok( 'ExtUtils::Liblist::Kid' );
-
     move_to_os_test_data_dir();
-    alias_kid_ext_for_convenience();
-
     conf_reset();
-
-    return test_kid_win32() if $^O eq 'MSWin32';
-    return;
+    test_common();
+    test_kid_win32() if $^O eq 'MSWin32';
 }
 
 # This allows us to get a clean playing field and ensure that the current
@@ -41,9 +37,9 @@ sub run {
 
 sub conf_reset {
     delete $Config{$_} for keys %Config;
+    $Config{installarchlib} = 'lib';
     delete $ENV{LIB};
     delete $ENV{LIBRARY_PATH};
-
     return;
 }
 
@@ -58,99 +54,88 @@ sub move_to_os_test_data_dir {
     return;
 }
 
-# With this we can use a short function name in the tests and use the same
-# one everywhere.
-
-sub alias_kid_ext_for_convenience {
-    my %os_ext_funcs = ( MSWin32 => \&ExtUtils::Liblist::Kid::_win32_ext, );
-    *_kid_ext = $os_ext_funcs{$^O} if $os_ext_funcs{$^O};
-
-    return;
-}
-sub _kid_ext;
-
 # Since liblist is object-based, we need to provide a mock object.
+sub _ext { ExtUtils::Liblist::Kid::ext( MockEUMM->new, @_ ); }
 
-sub _ext { _kid_ext( MockEUMM->new, @_ ); }
+sub quote { join ' ', map { qq{"$_"} } @_ }
+sub double { (@_) x 2 }
 
-# tests go here
+sub test_common {
+    is_deeply( [ _ext() ], [ ('') x 4 ], 'empty input results in empty output' );
+    is_deeply( [ _ext( 'unreal_test' ) ], [ ('') x 4 ], 'non-existent file results in empty output' );
+    is_deeply( [ _ext( undef, 0, 1 ) ], [ ('') x 4, [] ], 'asking for real names with empty input results in an empty extra array' );
+    is_deeply( [ _ext( 'unreal_test',     0, 1 ) ], [ ('') x 4, [] ], 'asking for real names with non-existent file results in an empty extra array' );
+}
 
 sub test_kid_win32 {
-
-    $Config{installarchlib} = 'lib';
-
-    is_deeply( [ _ext() ],                           [ '',                    '', '',                    '' ], 'empty input results in empty output' );
-    is_deeply( [ _ext( 'unreal_test' ) ],            [ '',                    '', '',                    '' ], 'non-existent file results in empty output' );
-    is_deeply( [ _ext( 'test' ) ],                   [ 'test.lib',            '', 'test.lib',            '' ], 'existent file results in a path to the file. .lib is default extension with empty %Config' );
-    is_deeply( [ _ext( 'c_test' ) ],                 [ 'lib\CORE\c_test.lib', '', 'lib\CORE\c_test.lib', '' ], '$Config{installarchlib}/CORE is the default search dir aside from cwd' );
-    is_deeply( [ _ext( 'double' ) ],                 [ 'double.lib',          '', 'double.lib',          '' ], 'once an instance of a lib is found, the search stops' );
-    is_deeply( [ _ext( 'test.lib' ) ],               [ 'test.lib',            '', 'test.lib',            '' ], 'the extension is not tacked on twice' );
-    is_deeply( [ _ext( 'test.a' ) ],                 [ 'test.a.lib',          '', 'test.a.lib',          '' ], 'but it will be tacked onto filenamess with other kinds of library extension' );
-    is_deeply( [ _ext( 'test test2' ) ],             [ 'test.lib test2.lib',  '', 'test.lib test2.lib',  '' ], 'multiple existing files end up separated by spaces' );
-    is_deeply( [ _ext( 'test test2 unreal_test' ) ], [ 'test.lib test2.lib',  '', 'test.lib test2.lib',  '' ], "some existing files don't cause false positives" );
-    is_deeply( [ _ext( '-l_test' ) ],                [ 'lib_test.lib',        '', 'lib_test.lib',        '' ], 'prefixing a lib with -l triggers a second search with prefix "lib" when gcc is not in use' );
-    is_deeply( [ _ext( '-l__test' ) ],               [ '__test.lib',          '', '__test.lib',          '' ], 'unprefixed lib files are found first when -l is used' );
-    is_deeply( [ _ext( '-llibtest' ) ],              [ '',                    '', '',                    '' ], 'if -l is used and the lib name is already prefixed no second search without the prefix is done' );
-    is_deeply( [ _ext( '-lunreal_test' ) ],          [ '',                    '', '',                    '' ], 'searching with -l for a non-existent library does not cause an endless loop' );
-    is_deeply( [ _ext( '"space lib"' ) ],            [ '"space lib.lib"',     '', '"space lib.lib"',     '' ], 'lib with spaces in the name can be found with the help of quotes' );
-    is_deeply( [ _ext( '"""space lib"""' ) ],        [ '"space lib.lib"',     '', '"space lib.lib"',     '' ], 'Text::Parsewords deals with extraneous quotes' );
-
-    is_deeply( [ scalar _ext( 'test' ) ], ['test.lib'], 'asking for a scalar gives a single string' );
-
-    is_deeply( [ _ext( undef,             0, 1 ) ], [ '',                                        '', '',                                        '', [] ],                      'asking for real names with empty input results in an empty extra array' );
-    is_deeply( [ _ext( 'unreal_test',     0, 1 ) ], [ '',                                        '', '',                                        '', [] ],                      'asking for real names with non-existent file results in an empty extra array' );
-    is_deeply( [ _ext( 'c_test',          0, 1 ) ], [ 'lib\CORE\c_test.lib',                     '', 'lib\CORE\c_test.lib',                     '', ['lib/CORE\c_test.lib'] ], 'asking for real names with an existent file in search dir results in an extra array with a mixed-os file path?!' );
-    is_deeply( [ _ext( 'test c_test',     0, 1 ) ], [ 'test.lib lib\CORE\c_test.lib',            '', 'test.lib lib\CORE\c_test.lib',            '', ['lib/CORE\c_test.lib'] ], 'files in cwd do not appear in the real name list?!' );
-    is_deeply( [ _ext( '-lc_test c_test', 0, 1 ) ], [ 'lib\CORE\c_test.lib lib\CORE\c_test.lib', '', 'lib\CORE\c_test.lib lib\CORE\c_test.lib', '', ['lib/CORE\c_test.lib'] ], 'finding the same lib in a search dir both with and without -l results in a single listing in the array' );
-
-    is_deeply( [ _ext( 'test :nosearch unreal_test test2' ) ],         [ 'test.lib unreal_test test2',     '', 'test.lib unreal_test test2',     '' ], ':nosearch can force passing through of filenames as they are' );
-    is_deeply( [ _ext( 'test :nosearch -lunreal_test test2' ) ],       [ 'test.lib unreal_test.lib test2', '', 'test.lib unreal_test.lib test2', '' ], 'lib names with -l after a :nosearch are suffixed with .lib and the -l is removed' );
-    is_deeply( [ _ext( 'test :nosearch unreal_test :search test2' ) ], [ 'test.lib unreal_test test2.lib', '', 'test.lib unreal_test test2.lib', '' ], ':search enables file searching again' );
-    is_deeply( [ _ext( 'test :meep test2' ) ],                         [ 'test.lib test2.lib',             '', 'test.lib test2.lib',             '' ], 'unknown :flags are safely ignored' );
+    is_deeply( [ _ext( 'test' ) ], [ double(quote('test.lib'), '') ], 'existent file results in a path to the file. .lib is default extension with empty %Config' );
+    is_deeply( [ _ext( 'c_test' ) ], [ double(quote('lib\CORE\c_test.lib'), '') ], '$Config{installarchlib}/CORE is the default search dir aside from cwd' );
+    is_deeply( [ _ext( 'double' ) ], [ double(quote('double.lib'), '') ], 'once an instance of a lib is found, the search stops' );
+    is_deeply( [ _ext( 'test.lib' ) ], [ double(quote('test.lib'), '') ], 'the extension is not tacked on twice' );
+    is_deeply( [ _ext( 'test.a' ) ], [ double(quote('test.a.lib'), '') ], 'but it will be tacked onto filenamess with other kinds of library extension' );
+    is_deeply( [ _ext( 'test test2' ) ], [ double(quote(qw(test.lib test2.lib)), '') ], 'multiple existing files end up separated by spaces' );
+    is_deeply( [ _ext( 'test test2 unreal_test' ) ], [ double(quote(qw(test.lib test2.lib)),  '') ], "some existing files don't cause false positives" );
+    is_deeply( [ _ext( '-l_test' ) ], [ double(quote('lib_test.lib'), '') ], 'prefixing a lib with -l triggers a second search with prefix "lib" when gcc is not in use' );
+    is_deeply( [ _ext( '-l__test' ) ], [ double(quote('__test.lib'), '') ], 'unprefixed lib files are found first when -l is used' );
+    is_deeply( [ _ext( '-llibtest' ) ], [ ('') x 4 ], 'if -l is used and the lib name is already prefixed no second search without the prefix is done' );
+    is_deeply( [ _ext( '-lunreal_test' ) ], [ ('') x 4 ], 'searching with -l for a non-existent library does not cause an endless loop' );
+    is_deeply( [ _ext( '"space lib"' ) ], [ double(quote('space lib.lib'), '') ], 'lib with spaces in the name can be found with the help of quotes' );
+    is_deeply( [ _ext( '"""space lib"""' ) ],        [ double(quote('space lib.lib'), '') ], 'Text::Parsewords deals with extraneous quotes' );
+
+    is_deeply( [ scalar _ext( 'test' ) ], [quote('test.lib')], 'asking for a scalar gives a single string' );
+
+    is_deeply( [ _ext( 'c_test', 0, 1 ) ], [ double(quote('lib\CORE\c_test.lib'), ''), [quote('lib/CORE\c_test.lib')] ], 'asking for real names with an existent file in search dir results in an extra array with a mixed-os file path?!' );
+    is_deeply( [ _ext( 'test c_test',     0, 1 ) ], [ double(quote(qw(test.lib lib\CORE\c_test.lib)), ''), [quote('lib/CORE\c_test.lib')] ], 'files in cwd do not appear in the real name list?!' );
+    is_deeply( [ _ext( '-lc_test c_test', 0, 1 ) ], [ double(quote(qw(lib\CORE\c_test.lib lib\CORE\c_test.lib)), ''), [quote('lib/CORE\c_test.lib')] ], 'finding the same lib in a search dir both with and without -l results in a single listing in the array' );
+
+    is_deeply( [ _ext( 'test :nosearch unreal_test test2' ) ], [ double(quote(qw(test.lib unreal_test test2)), '') ], ':nosearch can force passing through of filenames as they are' );
+    is_deeply( [ _ext( 'test :nosearch -lunreal_test test2' ) ],       [ double(quote(qw(test.lib unreal_test.lib test2)), '') ], 'lib names with -l after a :nosearch are suffixed with .lib and the -l is removed' );
+    is_deeply( [ _ext( 'test :nosearch unreal_test :search test2' ) ], [ double(quote(qw(test.lib unreal_test test2.lib)), '') ], ':search enables file searching again' );
+    is_deeply( [ _ext( 'test :meep test2' ) ], [ double(quote(qw(test.lib test2.lib)), '') ], 'unknown :flags are safely ignored' );
 
     my $curr = File::Spec->rel2abs( '' );
-    is_deeply( [ _ext( "-L$curr/dir dir_test" ) ], [ $curr . '\dir\dir_test.lib',         '', $curr . '\dir\dir_test.lib',         '' ], 'directories in -L parameters are searched' );
-    is_deeply( [ _ext( "-L/non_dir dir_test" ) ],  [ '',                                  '', '',                                  '' ], 'non-existent -L dirs are ignored safely' );
-    is_deeply( [ _ext( "-Ldir dir_test" ) ],       [ $curr . '\dir\dir_test.lib',         '', $curr . '\dir\dir_test.lib',         '' ], 'relative -L directories work' );
-    is_deeply( [ _ext( '-L"di r" dir_test' ) ],    [ '"' . $curr . '\di r\dir_test.lib"', '', '"' . $curr . '\di r\dir_test.lib"', '' ], '-L directories with spaces work' );
+    is_deeply( [ _ext( qq{"-L$curr/dir" dir_test} ) ], [ double(quote("$curr\\dir\\dir_test.lib"), '') ], 'directories in -L parameters are searched' );
+    is_deeply( [ _ext( "-L/non_dir dir_test" ) ], [ ('') x 4 ], 'non-existent -L dirs are ignored safely' );
+    is_deeply( [ _ext( qq{"-Ldir" dir_test} ) ], [ double(quote("$curr\\dir\\dir_test.lib"), '') ], 'relative -L directories work' );
+    is_deeply( [ _ext( '-L"di r" dir_test' ) ], [ double(quote($curr . '\di r\dir_test.lib'), '') ], '-L directories with spaces work' );
 
     $Config{perllibs} = 'pl';
-    is_deeply( [ _ext( 'unreal_test' ) ],            [ 'pl.lib', '', 'pl.lib', '' ], '$Config{perllibs} adds extra libs to be searched' );
-    is_deeply( [ _ext( 'unreal_test :nodefault' ) ], [ '',       '', '',       '' ], ':nodefault flag prevents $Config{perllibs} from being added' );
+    is_deeply( [ _ext( 'unreal_test' ) ], [ double(quote('pl.lib'), '') ], '$Config{perllibs} adds extra libs to be searched' );
+    is_deeply( [ _ext( 'unreal_test :nodefault' ) ], [ ('') x 4 ], ':nodefault flag prevents $Config{perllibs} from being added' );
     delete $Config{perllibs};
 
     $Config{libpth} = 'libpath';
-    is_deeply( [ _ext( 'lp_test' ) ], [ 'libpath\lp_test.lib', '', 'libpath\lp_test.lib', '' ], '$Config{libpth} adds extra search paths' );
+    is_deeply( [ _ext( 'lp_test' ) ], [ double(quote('libpath\lp_test.lib'), '') ], '$Config{libpth} adds extra search paths' );
     delete $Config{libpth};
 
     $Config{lib_ext} = '.meep';
-    is_deeply( [ _ext( 'test' ) ], [ 'test.meep', '', 'test.meep', '' ], '$Config{lib_ext} changes the lib extension to be searched for' );
+    is_deeply( [ _ext( 'test' ) ], [ double(quote('test.meep'), '') ], '$Config{lib_ext} changes the lib extension to be searched for' );
     delete $Config{lib_ext};
 
     $Config{lib_ext} = '.a';
-    is_deeply( [ _ext( 'imp' ) ], [ 'imp.dll.a', '', 'imp.dll.a', '' ], '$Config{lib_ext} == ".a" will find *.dll.a too' );
+    is_deeply( [ _ext( 'imp' ) ], [ double(quote('imp.dll.a'), '') ], '$Config{lib_ext} == ".a" will find *.dll.a too' );
     delete $Config{lib_ext};
 
     $Config{cc} = 'C:/MinGW/bin/gcc.exe';
 
-    is_deeply( [ _ext( 'test' ) ],                    [ 'test.lib',      '', 'test.lib',      '' ], '[gcc] searching for straight lib names remains unchanged' );
-    is_deeply( [ _ext( '-l__test' ) ],                [ 'lib__test.lib', '', 'lib__test.lib', '' ], '[gcc] lib-prefixed library files are found first when -l is in use' );
-    is_deeply( [ _ext( '-ltest' ) ],                  [ 'test.lib',      '', 'test.lib',      '' ], '[gcc] non-lib-prefixed library files are found on the second search when -l is in use' );
-    is_deeply( [ _ext( '-llibtest' ) ],               [ 'test.lib',      '', 'test.lib',      '' ], '[gcc] if -l is used and the lib name is already prefixed a second search without the lib is done' );
-    is_deeply( [ _ext( ':nosearch -lunreal_test' ) ], [ '-lunreal_test', '', '-lunreal_test', '' ], '[gcc] lib names with -l after a :nosearch remain as they are' );
+    is_deeply( [ _ext( 'test' ) ], [ double(quote('test.lib'), '') ], '[gcc] searching for straight lib names remains unchanged' );
+    is_deeply( [ _ext( '-l__test' ) ], [ double(quote('lib__test.lib'), '') ], '[gcc] lib-prefixed library files are found first when -l is in use' );
+    is_deeply( [ _ext( '-ltest' ) ], [ double(quote('test.lib'), '') ], '[gcc] non-lib-prefixed library files are found on the second search when -l is in use' );
+    is_deeply( [ _ext( '-llibtest' ) ], [ double(quote('test.lib'), '') ], '[gcc] if -l is used and the lib name is already prefixed a second search without the lib is done' );
+    is_deeply( [ _ext( ':nosearch -lunreal_test' ) ], [ double(quote('-lunreal_test'), '') ], '[gcc] lib names with -l after a :nosearch remain as they are' );
 
     $ENV{LIBRARY_PATH} = 'libpath';
-    is_deeply( [ _ext( 'lp_test' ) ], [ 'libpath\lp_test.lib', '', 'libpath\lp_test.lib', '' ], '[gcc] $ENV{LIBRARY_PATH} adds extra search paths' );
+    is_deeply( [ _ext( 'lp_test' ) ], [ double(quote('libpath\lp_test.lib'), '') ], '[gcc] $ENV{LIBRARY_PATH} adds extra search paths' );
     delete $ENV{LIBRARY_PATH};
 
     $Config{cc} = 'c:/Programme/Microsoft Visual Studio 9.0/VC/bin/cl.exe';
 
-    is_deeply( [ _ext( 'test' ) ], [ 'test.lib', '', 'test.lib', '' ], '[vc] searching for straight lib names remains unchanged' );
-    is_deeply( [ _ext( ':nosearch -Lunreal_test' ) ], [ '-libpath:unreal_test', '', '-libpath:unreal_test', '' ], '[vc] lib dirs with -L after a :nosearch are prefixed with -libpath:' );
+    is_deeply( [ _ext( 'test' ) ], [ double(quote('test.lib'), '') ], '[vc] searching for straight lib names remains unchanged' );
+    is_deeply( [ _ext( ':nosearch -Lunreal_test' ) ], [ double(quote('-libpath:unreal_test'), '') ], '[vc] lib dirs with -L after a :nosearch are prefixed with -libpath:' );
     ok( !exists $ENV{LIB}, '[vc] $ENV{LIB} is not autovivified' );
 
     $ENV{LIB} = 'vc';
-    is_deeply( [ _ext( 'vctest.lib' ) ], [ 'vc\vctest.lib', '', 'vc\vctest.lib', '' ], '[vc] $ENV{LIB} adds search paths' );
+    is_deeply( [ _ext( 'vctest.lib' ) ], [ double(quote('vc\vctest.lib'), '') ], '[vc] $ENV{LIB} adds search paths' );
 
     return;
 }
@@ -220,6 +220,6 @@ foreach (qw/ EXPORT_LIST PERL_ARCHIVE PERL_ARCHIVE_AFTER /)
     $t->cflags();
 
     # Brief bug where CCFLAGS was being blown away
-    is( $t->{CCFLAGS}, '-DMY_THING',    'cflags retains CCFLAGS' );
+    like( $t->{CCFLAGS}, qr/\-DMY_THING/,    'cflags retains CCFLAGS' );
 }
 
@@ -15,54 +15,52 @@ use Test::More;
 
 my $mm = bless {}, "MM";
 
-sub extract_params {
-    my $text = join "\n", @_;
-
-    $text =~ s{^\s* \# \s+ MakeMaker\ Parameters: \s*\n}{}x;
-    $text =~ s{^#}{}gms;
-    $text =~ s{\n}{,\n}g;
-
-    no strict 'subs';
-    return { eval "$text" };
+sub process_cmp {
+  my ($args, $expected, $label) = @_;
+  my $got = join '',
+    map "$_\n", $mm->_MakeMaker_Parameters_section($args || ());
+  $got =~ s/^#\s*MakeMaker Parameters:\n+//;
+  is $got, $expected, $label;
 }
 
-sub test_round_trip {
-    my $args = shift;
-    my $want = @_ ? shift : $args;
-
-    my $have = extract_params($mm->_MakeMaker_Parameters_section($args));
-
-    local $Test::Builder::Level = $Test::Builder::Level + 1;
-    is_deeply $have, $want or diag explain $have, "\n", $want;
-}
-
-is join("", $mm->_MakeMaker_Parameters_section()), <<'EXPECT', "nothing";
-#   MakeMaker Parameters:
+process_cmp undef, '', 'nothing';
+process_cmp { NAME => "Foo" }, <<'EXPECT', "name only";
+#     NAME => q[Foo]
+EXPECT
+process_cmp
+  { NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 0 } }, <<'EXPECT', "PREREQ v0";
+#     NAME => q[Foo]
+#     PREREQ_PM => { Foo::Bar=>q[0] }
+EXPECT
+process_cmp
+  { NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 1.23 } },
+  <<'EXPECT', "PREREQ v-non-0";
+#     NAME => q[Foo]
+#     PREREQ_PM => { Foo::Bar=>q[1.23] }
 EXPECT
 
-test_round_trip({ NAME => "Foo" });
-test_round_trip({ NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 0 } });
-test_round_trip({ NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 1.23 } });
-
-# Test the special case for BUILD_REQUIRES
-{
-    my $have = {
-        NAME                => "Foo",
-        PREREQ_PM           => { "Foo::Bar" => 1.23 },
-        BUILD_REQUIRES      => { "Baz"      => 0.12 },
-    };
-
-    my $want = {
-        NAME                => "Foo",
-        PREREQ_PM           => {
-            "Foo::Bar"  => 1.23,
-            "Baz"       => 0.12,
-        },
-        BUILD_REQUIRES      => { "Baz"      => 0.12 },
-    };
+process_cmp
+  {
+    NAME                => "Foo",
+    PREREQ_PM           => { "Foo::Bar" => 1.23 },
+    BUILD_REQUIRES      => { "Baz"      => 0.12 },
+  },
+  <<'EXPECT', "BUILD_REQUIRES";
+#     BUILD_REQUIRES => { Baz=>q[0.12] }
+#     NAME => q[Foo]
+#     PREREQ_PM => { Baz=>q[0.12], Foo::Bar=>q[1.23] }
+EXPECT
 
-    test_round_trip( $have, $want );
-}
+process_cmp
+  {
+    NAME                => "Foo",
+    PREREQ_PM           => { "Foo::Bar" => 1.23, Long => 1.45, Short => 0 },
+    BUILD_REQUIRES      => { "Baz"      => 0.12 },
+  },
+  <<'EXPECT', "ensure sorting";
+#     BUILD_REQUIRES => { Baz=>q[0.12] }
+#     NAME => q[Foo]
+#     PREREQ_PM => { Baz=>q[0.12], Foo::Bar=>q[1.23], Long=>q[1.45], Short=>q[0] }
+EXPECT
 
 done_testing();
-
@@ -5,16 +5,17 @@ BEGIN {
 }
 
 use strict;
-use Config;
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 9);
 
 use File::Spec;
 use File::Temp qw[tempdir];
 use MakeMaker::Test::Setup::PL_FILES;
 use MakeMaker::Test::Utils;
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 9);
 
 my $perl = which_perl();
 my $make = make_run();
@@ -3,6 +3,11 @@
 # This test puts MakeMaker through the paces of a basic perl module
 # build, test and installation of the Big::Fat::Dummy module.
 
+# Module::Install relies on being able to patch the generated Makefile
+# to add flags to $(PERL)
+# This test includes adding ' -Iinc' to $(PERL), and checking 'make install'
+# after that works. Done here as back-compat is considered basic.
+
 BEGIN {
     unshift @INC, 't/lib';
 }
@@ -10,13 +15,16 @@ BEGIN {
 use strict;
 use Config;
 use ExtUtils::MakeMaker;
+use utf8;
 
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 171);
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 171);
 use File::Find;
 use File::Spec;
 use File::Path;
@@ -24,6 +32,12 @@ use File::Temp qw[tempdir];
 
 my $perl = which_perl();
 my $Is_VMS = $^O eq 'VMS';
+my $OLD_CP; # crude but...
+if ($^O eq "MSWin32") {
+    $OLD_CP = $1 if qx(chcp) =~ /(\d+)$/ and $? == 0;
+    qx(chcp 1252) if defined $OLD_CP;
+}
+END { qx(chcp $OLD_CP) if $^O eq "MSWin32" and defined $OLD_CP }
 
 my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 );
 chdir $tmpdir;
@@ -43,8 +57,10 @@ END {
 ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
   diag("chdir failed: $!");
 
-my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
-END { rmtree '../dummy-install'; }
+sub extrachar { $] > 5.008 && !$ENV{PERL_CORE} ? utf8::decode(my $c='š') : 's' }
+my $DUMMYINST = '../dummy-in'.extrachar().'tall';
+my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=$DUMMYINST"});
+END { rmtree $DUMMYINST; }
 
 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
   diag(@mpl_out);
@@ -62,18 +78,18 @@ ok( -e $makefile,       'Makefile exists' );
 
 # -M is flakey on VMS
 my $mtime = (stat($makefile))[9];
-cmp_ok( $Touch_Time, '<=', $mtime,  '  its been touched' );
+cmp_ok( $Touch_Time, '<=', $mtime,  '  been touched' );
 
 END { unlink makefile_name(), makefile_backup() }
 
 my $make = make_run();
 
 {
-    # Supress 'make manifest' noise
+    # Suppress 'make manifest' noise
     local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
     my $manifest_out = run("$make manifest");
     ok( -e 'MANIFEST',      'make manifest created a MANIFEST' );
-    ok( -s 'MANIFEST',      '  its not empty' );
+    ok( -s 'MANIFEST',      '  not empty' );
 }
 
 END { unlink 'MANIFEST'; }
@@ -122,28 +138,42 @@ like( $test_out, qr/All tests successful/,  '  successful' );
 is( $?, 0,                                  '  exited normally' ) ||
     diag $test_out;
 
+# now simulate what Module::Install does, and edit $(PERL) to add flags
+open my $fh, '<', $makefile;
+my $mtext = join '', <$fh>;
+close $fh;
+$mtext =~ s/^(\s*PERL\s*=.*)$/$1 -Iinc/m;
+open $fh, '>', $makefile;
+print $fh $mtext;
+close $fh;
 
 my $install_out = run("$make install");
 is( $?, 0, 'install' ) || diag $install_out;
 like( $install_out, qr/^Installing /m );
 
-ok( -r '../dummy-install',     '  install dir created' );
-my %files = ();
-find( sub {
-    # do it case-insensitive for non-case preserving OSs
-    my $file = lc $_;
-
-    # VMS likes to put dots on the end of things that don't have them.
-    $file =~ s/\.$// if $Is_VMS;
-
-    $files{$file} = $File::Find::name;
-}, '../dummy-install' );
-ok( $files{'dummy.pm'},     '  Dummy.pm installed' );
-ok( $files{'liar.pm'},      '  Liar.pm installed'  );
-ok( $files{'program'},      '  program installed'  );
-ok( $files{'.packlist'},    '  packlist created'   );
-ok( $files{'perllocal.pod'},'  perllocal.pod created' );
+sub check_dummy_inst {
+    my $loc = shift;
+    my %files = ();
+    find( sub {
+	# do it case-insensitive for non-case preserving OSs
+	my $file = lc $_;
+	# VMS likes to put dots on the end of things that don't have them.
+	$file =~ s/\.$// if $Is_VMS;
+	$files{$file} = $File::Find::name;
+    }, $loc );
+    ok( $files{'dummy.pm'},     '  Dummy.pm installed' );
+    ok( $files{'liar.pm'},      '  Liar.pm installed'  );
+    ok( $files{'program'},      '  program installed'  );
+    ok( $files{'.packlist'},    '  packlist created'   );
+    ok( $files{'perllocal.pod'},'  perllocal.pod created' );
+    \%files;
+}
 
+SKIP: {
+    ok( -r $DUMMYINST,     '  install dir created' )
+	or skip "$DUMMYINST doesn't exist", 5;
+    check_dummy_inst($DUMMYINST);
+}
 
 SKIP: {
     skip 'VMS install targets do not preserve $(PREFIX)', 8 if $Is_VMS;
@@ -153,13 +183,7 @@ SKIP: {
     like( $install_out, qr/^Installing /m );
 
     ok( -r 'elsewhere',     '  install dir created' );
-    %files = ();
-    find( sub { $files{$_} = $File::Find::name; }, 'elsewhere' );
-    ok( $files{'Dummy.pm'},     '  Dummy.pm installed' );
-    ok( $files{'Liar.pm'},      '  Liar.pm installed'  );
-    ok( $files{'program'},      '  program installed'  );
-    ok( $files{'.packlist'},    '  packlist created'   );
-    ok( $files{'perllocal.pod'},'  perllocal.pod created' );
+    check_dummy_inst('elsewhere');
     rmtree('elsewhere');
 }
 
@@ -173,19 +197,10 @@ SKIP: {
     like( $install_out, qr/^Installing /m );
 
     ok( -d 'other',  '  destdir created' );
-    %files = ();
-    my $perllocal;
-    find( sub {
-        $files{$_} = $File::Find::name;
-    }, 'other' );
-    ok( $files{'Dummy.pm'},     '  Dummy.pm installed' );
-    ok( $files{'Liar.pm'},      '  Liar.pm installed'  );
-    ok( $files{'program'},      '  program installed'  );
-    ok( $files{'.packlist'},    '  packlist created'   );
-    ok( $files{'perllocal.pod'},'  perllocal.pod created' );
+    my $files = check_dummy_inst('other');
 
-    ok( open(PERLLOCAL, $files{'perllocal.pod'} ) ) ||
-        diag("Can't open $files{'perllocal.pod'}: $!");
+    ok( open(PERLLOCAL, $files->{'perllocal.pod'} ) ) ||
+        diag("Can't open $files->{'perllocal.pod'}: $!");
     { local $/;
       unlike(<PERLLOCAL>, qr/other/, 'DESTDIR should not appear in perllocal');
     }
@@ -214,13 +229,7 @@ SKIP: {
 
     ok( !-d 'elsewhere',       '  install dir not created' );
     ok( -d 'other/elsewhere',  '  destdir created' );
-    %files = ();
-    find( sub { $files{$_} = $File::Find::name; }, 'other/elsewhere' );
-    ok( $files{'Dummy.pm'},     '  Dummy.pm installed' );
-    ok( $files{'Liar.pm'},      '  Liar.pm installed'  );
-    ok( $files{'program'},      '  program installed'  );
-    ok( $files{'.packlist'},    '  packlist created'   );
-    ok( $files{'perllocal.pod'},'  perllocal.pod created' );
+    check_dummy_inst('other/elsewhere');
     rmtree('other');
 }
 
@@ -394,7 +403,7 @@ note "META file validity"; {
 
 
 # Make sure init_dirscan doesn't go into the distdir
-@mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
+@mpl_out = run(qq{$perl Makefile.PL "PREFIX=$DUMMYINST"});
 
 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
 
@@ -413,7 +422,6 @@ is( $?, 0, 'realclean' ) || diag($realclean_out);
 open(STDERR, ">&SAVERR") or die $!;
 close SAVERR;
 
-
 sub _normalize {
     my $hash = shift;
 
@@ -34,7 +34,7 @@ my @cd_args = ($dir, "command1", "command2");
 qq{cd $dir
 	command1
 	command2
-	cd $expected_updir};
+	cd $expected_updir}, 'nmake';
     }
 
     {
@@ -42,14 +42,14 @@ qq{cd $dir
 
         ::is $mm->cd(@cd_args),
 qq{cd $dir && command1
-	cd $dir && command2};
+	cd $dir && command2}, 'dmake';
     }
 }
 
 {
     is +ExtUtils::MM_Unix->cd(@cd_args),
 qq{cd $dir && command1
-	cd $dir && command2};
+	cd $dir && command2}, 'Unix';
 }
 
 SKIP: {
@@ -61,5 +61,5 @@ q{startdir = F$Environment("Default")
 	Set Default [.some.dir]
 	command1
 	command2
-	Set Default 'startdir'};
+	Set Default 'startdir'}, 'VMS';
 }
@@ -15,9 +15,10 @@ use File::Temp;
 use Cwd 'abs_path';
 
 use Test::More;
-
-plan skip_all => "no toolchain installed when cross-compiling"
-    if $ENV{PERL_CORE} && $Config{'usecrosscompile'};
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : ();
 
 #--------------------- Setup
 
@@ -0,0 +1,90 @@
+package MakeMaker::Test::Setup::Unicode;
+
+@ISA = qw(Exporter);
+require Exporter;
+@EXPORT = qw(setup_recurs teardown_recurs);
+
+use strict;
+use File::Path;
+use File::Basename;
+use MakeMaker::Test::Utils;
+use utf8;
+use Config;
+
+my %Files = (
+             'Problem-Module/Makefile.PL'   => <<'PL_END',
+use ExtUtils::MakeMaker;
+use utf8;
+
+WriteMakefile(
+    NAME          => 'Problem::Module',
+    ABSTRACT_FROM => 'lib/Problem/Module.pm',
+    AUTHOR        => q{Danijel Tašov},
+    EXE_FILES     => [ qw(bin/probscript) ],
+    INSTALLMAN1DIR => "some", # even if disabled in $Config{man1dir}
+    MAN1EXT       => 1, # set to 0 if man pages disabled
+);
+PL_END
+
+            'Problem-Module/lib/Problem/Module.pm'  => <<'pm_END',
+use utf8;
+
+=pod
+
+=encoding utf8
+
+=head1 NAME
+
+Problem::Module - Danijel Tašov's great new module
+
+=cut
+
+1;
+pm_END
+
+            'Problem-Module/bin/probscript'  => <<'pl_END',
+#!/usr/bin/perl
+use utf8;
+
+=encoding utf8
+
+=head1 NAME
+
+文档 - Problem script
+pl_END
+);
+
+
+sub setup_recurs {
+    while(my($file, $text) = each %Files) {
+        # Convert to a relative, native file path.
+        $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file);
+
+        my $dir = dirname($file);
+        mkpath $dir;
+        my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8";
+        open(FILE, ">$utf8", $file) || die "Can't create $file: $!";
+        print FILE $text;
+        close FILE;
+
+        # ensure file at least 1 second old for makes that assume
+        # files with the same time are out of date.
+        my $time = calibrate_mtime();
+        utime $time, $time - 1, $file;
+    }
+
+    return 1;
+}
+
+sub teardown_recurs {
+    foreach my $file (keys %Files) {
+        my $dir = dirname($file);
+        if( -e $dir ) {
+            rmtree($dir) || return;
+        }
+    }
+    return 1;
+}
+
+
+1;
@@ -8,8 +8,11 @@ use strict;
 use File::Path;
 use File::Basename;
 use MakeMaker::Test::Utils;
+use Config;
 
-my $Is_VMS = $^O eq 'VMS';
+use ExtUtils::MM;
+my $typemap = 'type map';
+$typemap =~ s/ //g unless MM->new({NAME=>'name'})->can_dep_space;
 
 my %Files = (
              'XS-Test/lib/XS/Test.pm'     => <<'END',
@@ -27,15 +30,19 @@ bootstrap XS::Test $VERSION;
 1;
 END
 
-             'XS-Test/Makefile.PL'          => <<'END',
+             'XS-Test/Makefile.PL'          => <<END,
 use ExtUtils::MakeMaker;
 
 WriteMakefile(
     NAME          => 'XS::Test',
     VERSION_FROM  => 'lib/XS/Test.pm',
+    TYPEMAPS      => [ '$typemap' ],
+    PERL          => "\$^X -w",
 );
 END
 
+             "XS-Test/$typemap"             => '',
+
              'XS-Test/Test.xs'              => <<'END',
 #include "EXTERN.h"
 #include "perl.h"
@@ -30,6 +30,7 @@ our @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup
         HARNESS_VERBOSE
         PREFIX
         MAKEFLAGS
+        PERL_INSTALL_QUIET
     );
 
     my %default_env_keys;
@@ -97,7 +98,7 @@ MakeMaker::Test::Utils - Utility routines for testing MakeMaker
 
 =head1 DESCRIPTION
 
-A consolidation of little utility functions used through out the
+A consolidation of little utility functions used throughout the
 MakeMaker test suite.
 
 =head2 Functions
@@ -138,6 +139,7 @@ sub which_perl {
             last if -x $perlpath;
         }
     }
+    $perlpath = qq{"$perlpath"}; # "safe... in a command line" even with spaces
 
     return $perlpath;
 }
@@ -213,7 +215,7 @@ sub make {
     my $make = $Config{make};
     $make = $ENV{MAKE} if exists $ENV{MAKE};
 
-    return $make;
+    return $Is_VMS ? $make : qq{"$make"};
 }
 
 =item B<make_run>
@@ -304,10 +306,7 @@ sub run {
 
     # Unix, modern Windows and OS/2 from 5.005_54 up can handle 2>&1
     # This makes our failure diagnostics nicer to read.
-    if( MM->os_flavor_is('Unix')                                   or
-        (MM->os_flavor_is('Win32') and !MM->os_flavor_is('Win9x')) or
-        ($] > 5.00554 and MM->os_flavor_is('OS/2'))
-      ) {
+    if (MM->can_redirect_error) {
         return `$cmd 2>&1`;
     }
     else {
@@ -116,7 +116,7 @@ note "version object in provides"; {
         META_ADD => {
             provides => {
                 "CPAN::Testers::ParseReport" => {
-                    version => version->declare("v1.2.3"),
+                    version => version->new("v1.2.3"),
                     file    => "lib/CPAN/Testers/ParseReport.pm"
                 }
             }
@@ -8,15 +8,16 @@ BEGIN {
 }
 
 use strict;
-use Config;
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 36);
 
 use TieOut;
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::MPV;
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 36);
 use File::Path;
 
 use ExtUtils::MakeMaker;
@@ -6,22 +6,17 @@
 use strict;
 use lib 't/lib';
 
-use Config;
 use Test::More;
+use Config;
 
 # In a BEGIN block so the END tests aren't registered.
 BEGIN {
-    plan skip_all => "miniperl test only necessary for the perl core"
+    plan skip_all => 'miniperl test only necessary for the perl core'
       if !$ENV{PERL_CORE};
 
-    plan skip_all => "no toolchain installed when cross-compiling"
-      if $ENV{PERL_CORE} && $Config{'usecrosscompile'};
-
-    plan "no_plan";
-}
-
-BEGIN {
-    ok !$INC{"ExtUtils/MakeMaker.pm"}, "MakeMaker is not yet loaded";
+    plan $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+      ? (skip_all => 'cross-compiling and make not available')
+      : 'no_plan';
 }
 
 # Disable all XS from here on
@@ -32,7 +27,6 @@ use ExtUtils::MakeMaker;
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
 
-
 my $perl     = which_perl();
 my $makefile = makefile_name();
 my $make     = make_run();
@@ -12,6 +12,7 @@ use Test::More tests => 16;
 use File::Spec;
 
 my $TB = Test::More->builder;
+my $perl = which_perl;
 
 BEGIN { use_ok('ExtUtils::MM') }
 
@@ -23,7 +24,7 @@ isa_ok($mm, 'ExtUtils::MM_Any');
 sub try_oneliner {
     my($code, $switches, $expect, $name) = @_;
     my $cmd = $mm->oneliner($code, $switches);
-    $cmd =~ s{\$\(ABSPERLRUN\)}{$^X};
+    $cmd =~ s{\$\(ABSPERLRUN\)}{$perl};
 
     # VMS likes to put newlines at the end of commands if there isn't
     # one already.
@@ -29,6 +29,7 @@ my %versions = (q[$VERSION = '1.00']            => '1.00',
                 q[our $VERSION = '1.23';]       => '1.23',
                 q[$CGI::VERSION='3.63']         => '3.63',
                 q[$VERSION = "1.627"; # ==> ALSO update the version in the pod text below!] => '1.627',
+                q[BEGIN { our $VERSION = '1.23' }]       => '1.23',
 
                 '$Something::VERSION == 1.0'    => undef,
                 '$Something::VERSION <= 1.0'    => undef,
@@ -5,23 +5,24 @@
 use strict;
 use lib 't/lib';
 
-use Config;
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : 'no_plan';
 use File::Temp qw[tempdir];
 
 use ExtUtils::MakeMaker;
 
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
-
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : 'no_plan';
 
 my $perl     = which_perl();
 my $makefile = makefile_name();
 my $make     = make_run();
 
+local $ENV{PERL_INSTALL_QUIET};
 
 # Setup our test environment
 {
@@ -70,7 +71,10 @@ my $make     = make_run();
     run_ok(qq{$perl Makefile.PL});
 
     # XXX This is a fragile way to check that it reran.
-    like run_ok($make), qr/^Skip /ms;
+    TODO: {
+      local $TODO = 'This one is fragile on some systems for some reason that needs investigation';
+      like run_ok($make), qr/^Skip /ms;
+    }
 
     ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );
 }
@@ -7,6 +7,7 @@ BEGIN {
 }
 
 use strict;
+use Config;
 use Test::More tests => 8;
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::BFD;
@@ -33,6 +34,11 @@ ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) ||
 {
     my $warnings = '';
     local $SIG{__WARN__} = sub {
+        if ( $Config{usecrosscompile} ) {
+            # libraries might not be present on the target system
+            # when cross-compiling
+            return if $_[0] =~ /\A\QWarning (mostly harmless): No library found for \E.+/
+        }
         $warnings = join '', @_;
     };
 
@@ -8,6 +8,7 @@ BEGIN {
 }
 
 use strict;
+use Config;
 use Test::More tests => 16;
 use File::Temp qw[tempdir];
 
@@ -35,6 +36,11 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
     ok( my $stdout = tie *STDOUT, 'TieOut' );
     my $warnings = '';
     local $SIG{__WARN__} = sub {
+        if ( $Config{usecrosscompile} ) {
+            # libraries might not be present on the target system
+            # when cross-compiling
+            return if $_[0] =~ /\A\QWarning (mostly harmless): No library found for \E.+/
+        }
         $warnings .= join '', @_;
     };
     # prerequisite warnings are disabled while building the perl core:
@@ -9,14 +9,16 @@ BEGIN {
 use strict;
 use Config;
 
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 26);
 use File::Temp qw[tempdir];
 
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::Recurs;
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 26);
 
 # 'make disttest' sets a bunch of environment variables which interfere
 # with our testing.
@@ -8,16 +8,18 @@ BEGIN {
 }
 
 use strict;
-use Config;
-use Test::More
-    $ENV{PERL_CORE} && $Config{'usecrosscompile'}
-    ? (skip_all => "no toolchain installed when cross-compiling")
-    : (tests => 20);
 
 use TieOut;
 use MakeMaker::Test::Utils;
 use MakeMaker::Test::Setup::SAS;
+use Config;
+use Test::More;
+use ExtUtils::MM;
+plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+    ? (skip_all => "cross-compiling and make not available")
+    : (tests => 20);
 use File::Path;
+use File::Temp qw[tempdir];
 
 use ExtUtils::MakeMaker;
 
@@ -28,7 +30,8 @@ my $perl     = which_perl();
 my $make     = make_run();
 my $makefile = makefile_name();
 
-chdir 't';
+my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 );
+chdir $tmpdir;
 
 perl_lib();
 
@@ -0,0 +1,87 @@
+# Test problems in Makefile.PL's and hint files.
+
+BEGIN {
+    unshift @INC, 't/lib';
+}
+chdir 't';
+
+use strict;
+use Test::More;
+use Config;
+BEGIN {
+  plan skip_all => 'Need perlio and perl 5.8+.'
+    if $] < 5.008 or !$Config{useperlio};
+  plan tests => 9;
+}
+use ExtUtils::MM;
+use MakeMaker::Test::Setup::Unicode;
+use MakeMaker::Test::Utils qw(makefile_name make_run run);
+use TieOut;
+
+my $MM = bless { DIR => ['.'] }, 'MM';
+
+ok( setup_recurs(), 'setup' );
+END {
+    ok( chdir File::Spec->updir, 'chdir updir' );
+    ok( teardown_recurs(), 'teardown' );
+}
+
+ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) ||
+  diag("chdir failed: $!");
+
+if ($] >= 5.008) {
+  eval { require ExtUtils::MakeMaker::Locale; };
+  note "ExtUtils::MakeMaker::Locale vars: $ExtUtils::MakeMaker::Locale::ENCODING_LOCALE;$ExtUtils::MakeMaker::Locale::ENCODING_LOCALE_FS;$ExtUtils::MakeMaker::Locale::ENCODING_CONSOLE_IN;$ExtUtils::MakeMaker::Locale::ENCODING_CONSOLE_OUT\n" unless $@;
+  note "Locale env vars: " . join(';', map {
+    "$_=$ENV{$_}"
+  } grep { /LANG|LC/ } keys %ENV) . "\n";
+}
+
+# Make sure when Makefile.PL's break, they issue a warning.
+# Also make sure Makefile.PL's in subdirs still have '.' in @INC.
+{
+    my $stdout = tie *STDOUT, 'TieOut' or die;
+
+    my $warning = '';
+    local $SIG{__WARN__} = sub { $warning .= join '', @_ };
+    $MM->eval_in_subdirs;
+    my $warnlines = grep { !/does not map to/ } split "\n", $warning;
+    is $warnlines, 0, 'no warning' or diag $warning;
+
+    open my $json_fh, '<:utf8', 'MYMETA.json' or die $!;
+    my $json = do { local $/; <$json_fh> };
+    close $json_fh;
+
+    require Encode;
+    my $str = Encode::decode( 'utf8', "Danijel Tašov's" );
+    like( $json, qr/$str/, 'utf8 abstract' );
+
+    untie *STDOUT;
+}
+
+my $make = make_run();
+my $make_out = run("$make");
+is $? >> 8, 0, 'Exit code of make == 0';
+
+my $manfile = File::Spec->catfile(qw(blib man1 probscript.1));
+SKIP: {
+  skip 'Manpage not generated', 1 unless -f $manfile;
+  skip 'Pod::Man >= 2.17 needed', 1 unless do {
+    require Pod::Man; $Pod::Man::VERSION >= 2.17;
+  };
+  open my $man_fh, '<:utf8', $manfile or die "open $manfile: $!";
+  my $man = do { local $/; <$man_fh> };
+  close $man_fh;
+
+  require Encode;
+  my $str = Encode::decode( 'utf8', "文档" );
+  like( $man, qr/$str/, 'utf8 man-snippet' );
+}
+
+$make_out = run("$make realclean");
+is $? >> 8, 0, 'Exit code of make == 0';
+
+sub makefile_content {
+  open my $fh, '<', makefile_name or die;
+  return <$fh>;
+}
@@ -0,0 +1,73 @@
+#!/usr/bin/perl -w
+
+# test support for various forms of vstring versions in PREREQ_PM
+
+# Magic for core
+BEGIN {
+    # Always run in t to unify behaviour with core
+    chdir 't' if -d 't';
+}
+
+# Use things from t/lib/
+use lib './lib';
+use strict;
+use warnings;
+use TieOut;
+use MakeMaker::Test::Utils qw(makefile_name);
+use File::Temp qw[tempdir];
+
+use ExtUtils::MakeMaker;
+use Test::More;
+
+my $tmpdir = tempdir( DIR => '.', CLEANUP => 1 );
+chdir $tmpdir;
+
+sub capture_make {
+    my ($package, $version) = @_ ;
+
+    my $warnings = '';
+    local $SIG{__WARN__} = sub {
+        $warnings .= join '', @_;
+    };
+
+    local $ENV{PERL_CORE} = 0;
+
+    WriteMakefile(
+        NAME      => 'VString::Test',
+        PREREQ_PM => { $package , $version }
+    );
+
+    return $warnings;
+}
+
+sub makefile_content {
+    open my $fh, '<', makefile_name or die;
+    return <$fh>;
+}
+
+# [ pkg, version, pattern, descrip, invertre ]
+my @DATA = (
+  [ DecimalString => '1.2.3', qr/isn't\s+numeric/, '3-part Decimal String' ],
+  [ VDecimalString => 'v1.2.3', qr/Unparsable\s+version/, '3-part V-Decimal String' ],
+  [ BareVString => v1.2.3, qr/Unparsable\s+version/, '3-part bare V-string' ],
+  [ VDecimalString => 'v1.2', qr/Unparsable\s+version/, '2-part v-decimal string' ],
+  [ BareVString => v1.2, qr/Unparsable\s+version/, '2-part bare v-string' ],
+  [ BrokenString => 'nan', qr/Unparsable\s+version/, 'random string', 1 ],
+);
+
+ok(my $stdout = tie *STDOUT, 'TieOut');
+for my $tuple (@DATA) {
+  my ($pkg, $version, $pattern, $descrip, $invertre) = @$tuple;
+  next if $] < 5.008 && $pkg eq 'BareVString' && $descrip =~ m!^2-part!;
+  my $out;
+  eval { $out = capture_make("Fake::$pkg" => $version); };
+  is($@, '', "$descrip not fatal");
+  if ($invertre) {
+    like ( $out , qr/$pattern/i, "$descrip parses");
+  } else {
+    unlike ( $out , qr/$pattern/i , "$descrip parses");
+  }
+#  note(join q{}, grep { $_ =~ /Fake/i } makefile_content);
+}
+
+done_testing();
@@ -8,6 +8,7 @@ BEGIN {
 }
 
 use strict;
+use Config;
 use Test::More tests => 43;
 
 use TieOut;
@@ -35,6 +36,11 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
     ok( my $stdout = tie *STDOUT, 'TieOut' );
     my $warnings = '';
     local $SIG{__WARN__} = sub {
+        if ( $Config{usecrosscompile} ) {
+            # libraries might not be present on the target system
+            # when cross-compiling
+            return if $_[0] =~ /\A\QWarning (mostly harmless): No library found for \E.+/
+        }
         $warnings .= join '', @_;
     };
 
@@ -266,13 +272,13 @@ VERIFY
 
     # PERL_MM_OPT
     {
-      local $ENV{PERL_MM_OPT} = 'INSTALL_BASE="/Users/miyagawa/tmp/car1 foo/foo bar"';
+      local $ENV{PERL_MM_OPT} = 'INSTALL_BASE="/Users/miyagawa/tmp/car1  foo/foo bar"';
       $mm = WriteMakefile(
           NAME            => 'Big::Dummy',
           VERSION    => '1.00',
       );
 
-      is( $mm->{INSTALL_BASE}, "/Users/miyagawa/tmp/car1 foo/foo bar", 'parse_args() splits like shell' );
+      is( $mm->{INSTALL_BASE}, "/Users/miyagawa/tmp/car1  foo/foo bar", 'parse_args() splits like shell' );
     }
 
 }
@@ -13,9 +13,7 @@ use Test::More
     have_compiler()
     ? (tests => 5)
     : (skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler");
-use File::Find;
 use File::Spec;
-use File::Path;
 
 my $Is_VMS = $^O eq 'VMS';
 my $perl = which_perl();
@@ -36,15 +34,20 @@ ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
   diag("chdir failed: $!");
 
 my @mpl_out = run(qq{$perl Makefile.PL});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
-  diag(@mpl_out);
-
-my $make = make_run();
-my $make_out = run("$make");
-is( $?, 0,                                 '  make exited normally' ) ||
-    diag $make_out;
-
-my $test_out = run("$make test");
-is( $?, 0,                                 '  make test exited normally' ) ||
-    diag $test_out;
+SKIP: {
+  unless (cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' )) {
+    diag(@mpl_out);
+    skip 'perl Makefile.PL failed', 2;
+  }
+
+  my $make = make_run();
+  my $make_out = run("$make");
+  unless (is( $?, 0, '  make exited normally' )) {
+      diag $make_out;
+      skip 'Make failed - skipping test', 1;
+  }
+
+  my $test_out = run("$make test");
+  is( $?, 0,                                 '  make test exited normally' ) ||
+      diag $test_out;
+}