don't pollute M::I plugin detector with GetOptions symbol from GetOpt::Long
Rafael Kitover [Thu, 17 Jun 2010 02:44:10 +0000 (22:44 -0400)]
Changes
lib/Module/Install/Catalyst.pm

diff --git a/Changes b/Changes
index 9956a44..7b21b7d 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension Catalyst-Devel.
 
+        - don't pollute M::I plugin detector with GetOptions symbol from
+          GetOpt::Long
+
 1.28 2010-06-16 02:43:00
         - Fix generated Pod tests so that the first check is if the TEST_POD
           environment variable is set. (RT#58433)
index cd29c7e..2dfae94 100644 (file)
@@ -10,7 +10,7 @@ use File::Find;
 use FindBin;
 use File::Copy::Recursive 'rcopy';
 use File::Spec ();
-use Getopt::Long qw(GetOptionsFromString :config no_ignore_case);
+use Getopt::Long ();
 use Data::Dumper;
 
 my $SAFETY = 0;
@@ -214,13 +214,17 @@ catalyst_par_options().
 
 sub catalyst_par_options {
     my ( $self, $optstring ) = @_;
-    my %o = ();
     eval "use PAR::Packer ()";
     if ($@) {
         warn "WARNING: catalyst_par_options ignored - you need PAR::Packer\n"
     }
     else {
-        GetOptionsFromString($optstring, \%o, PAR::Packer->options);
+        my $p = Getopt::Long::Parser->new(config => ['no_ignore_case']);
+        my %o;
+        {
+            local @ARGV = $optstring;
+            $p->getoptions(\%o, PAR::Packer->options);
+        }
         %PAROPTS = ( %PAROPTS, %o);
     }
 }