develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [ID 20001214.008] ExtUtils::Installed doesn't like '\'

Thread Previous
From:
Robin Barker
Date:
December 14, 2000 06:26
Subject:
Re: [ID 20001214.008] ExtUtils::Installed doesn't like '\'
Message ID:
200012141425.OAA26534@tempest.npl.co.uk

> I'm a using Perl5.6 on WinNT and Linux.
> ExtUtils::Installed works fine on Linux, does not work on WinNT.
> 
> I found that error occurs on these lines:
> <quote>
>    $module =~ s!$Config{archlib}/auto/(.*)/.packlist!$1!s;
>    $module =~ s!$Config{sitearch}/auto/(.*)/.packlist!$1!s;
> </quote>
> 
> I think that backslash(es) contained in $Config{archlib} and 
> $Config{sitesearch} occurs error.So I change these lines like 
> below and it works fine:
> <quote>
> #   $module =~ s!$Config{archlib}/auto/(.*)/.packlist!$1!s;
> #   $module =~ s!$Config{sitearch}/auto/(.*)/.packlist!$1!s;
> #---Modify---------
>    my $sCfg = $Config{archlib};
>    $sCfg =~ s/\\/\\\\/g;
>    $module =~ s!$sCfg/auto/(.*)/.packlist!$1!s;
>    my $sCfg = $Config{sitearch};
>    $sCfg =~ s/\\/\\\\/g;
>    $module =~ s!$sCfg/auto/(.*)/.packlist!$1!s;
> #---Modify---------
> </quote>

Is this the "correct" patch:

--- lib/ExtUtils/Installed.pm   2000/12/14 14:23:08     1.1
+++ lib/ExtUtils/Installed.pm   2000/12/14 14:24:44     1.2
@@ -67,8 +67,8 @@
 
    # Hack of the leading bits of the paths & convert to a module name
    my $module = $File::Find::name;
-   $module =~ s!$Config{archlib}/auto/(.*)/.packlist!$1!s;
-   $module =~ s!$Config{sitearch}/auto/(.*)/.packlist!$1!s;
+   $module =~ s!\Q$Config{archlib}\E/auto/(.*)/.packlist!$1!s;
+   $module =~ s!\Q$Config{sitearch}\E/auto/(.*)/.packlist!$1!s;
    my $modfile = "$module.pm";
    $module =~ s!/!::!g;
 
Robin

-- 
Robin Barker                        | Email: Robin.Barker@npl.co.uk
CMSC, Building 10,                  | Phone: +44 (0) 20 8943 7090
National Physical Laboratory,       | Fax:   +44 (0) 20 8977 7091
Teddington, Middlesex, UK. TW11 OLW | WWW:   http://www.npl.co.uk

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About