diff options
author | Steffen Mueller <wyp3rlx02@sneakemail.com> | 2008-06-01 19:36:55 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-06-01 19:00:08 +0000 |
commit | a811a5cf5ba5b36dcbcd934066ae037d7f53f5ee (patch) | |
tree | 1ff48a526963eae967c27ef1306075dec506b1d6 /lib/lib_pm.PL | |
parent | ac0638ad0560c94bdd1b77078f2c536664a9f167 (diff) | |
download | perl-a811a5cf5ba5b36dcbcd934066ae037d7f53f5ee.tar.gz |
Fix for lib.pm Config detection
Message-ID: <20080601153657.26607.qmail@lists.develooper.com>
p4raw-id: //depot/perl@33980
Diffstat (limited to 'lib/lib_pm.PL')
-rw-r--r-- | lib/lib_pm.PL | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/lib_pm.PL b/lib/lib_pm.PL index c12570828f..3332df7f05 100644 --- a/lib/lib_pm.PL +++ b/lib/lib_pm.PL @@ -6,7 +6,7 @@ use Cwd; my $origdir = cwd; chdir dirname($0); my $file = basename($0, '.PL'); -$file =~ s!_(pm)$!.$1!i; +$file =~ s/_(pm)$/.$1/i; my $useConfig; my $Config_archname; @@ -31,14 +31,15 @@ else { open my $fh, '<', $lib_file or die "Could not open file '$lib_file' for reading: $!"; my $ConfigRegex = qr/(?:use|require)\s+Config(?:\s+|;)/; + my $found_config = 0; while (defined($_ = <$fh>)) { # crude heuristics to check that we were using Config if (/^\s*$ConfigRegex/ || /^\s*eval.*$ConfigRegex/) { - $expand_config_vars = 0; + $found_config = 1; last; } } - $expand_config_vars = 1; + $expand_config_vars = $found_config ? 0 : 1; HERE $expand_config_vars = 0 if $@; } @@ -51,7 +52,7 @@ if ($expand_config_vars) { reverse split / /, $Config{inc_version_list}; $Config_inc_version_list = @Config_inc_version_list ? - qq(@Config_inc_version_list) : q(()); + qq(qw(@Config_inc_version_list)) : q(()); } else { $useConfig = 'use Config;'; $Config_archname = q($Config{archname}); |