develooper Front page | perl.perl5.porters | Postings from September 2012

Re: on VMS: (was Re: [Round 2] Taking CPANPLUS out of core)

Thread Previous | Thread Next
Craig A. Berry
September 30, 2012 19:04
Re: on VMS: (was Re: [Round 2] Taking CPANPLUS out of core)
Message ID:
On Sun, Sep 30, 2012 at 7:58 PM, David Golden <> wrote:
> On Sun, Sep 30, 2012 at 10:33 AM, Craig A. Berry
> <> wrote:
>> And note that I do have write access to the Perl library directories,
>> in this case on two counts: I'm the owner of them and I'm also running
>> with privileges that give me write access to everything.  So whatever
>> it's doing to detect that is simply wrong in this environment, and
>> there are probably many such portability gotchas.
> Hi, Craig.  It's doing this:
>   sub _can_write_to_libdirs {
>       return -w $Config{installprivlib}
>           && -w $Config{installarchlib}
>           && -w $Config{installsitelib}
>           && -w $Config{installsitearch}
>   }
> Do some of those just wind up undefined on VMS?

Thanks for looking up how it's done.  No, they are all defined (from a
recent blead build directory):

$ search installprivlib,installarchlib,installsitelib,installsitearch

and I do have write access:

$ perl -we "use Config; print -w $Config{installprivlib};"
$ perl -we "use Config; print -w $Config{installarchlib};"
$ perl -we "use Config; print -w $Config{installsitelib};"
$ perl -we "use Config; print -w $Config{installsitearch};"

> I'm happy to try to help debug/fix on VMS, even if that's just
> to skip the kind of tricky help (like boostrapping local::lib) that
> works on Unix, but I definitely would need more help figuring out the
> variances.
> The "can't create" appears to be a failure of File::Path::mkpath on
> the path shown in the error ("d0:[craig]/.cpan").  Clearly, the loop
> should bail out if there's a problem and that's poor.

Yeah, maybe a retry limit of 10 or something.

> Where the
> directory comes from is tricky, but my guess is that it's just
> effectively "$ENV{HOME}/.cpan".  (And, yes, I found a hardcoded "/"
> join rather than File::Spec.  Not sure if that matters.)

My guess would be that it's happening here:

$ search [.cpan.CPAN...]*.pm ".cpan"""


    @dirs = map { "$_/.cpan" } grep { defined } @dirs;

Converting $_ to Unix format would be a start, though using
File::Spec->catdir($_, '.cpan') could also work, depending on what
else is going to be done with that directory specification.  Typically
we would also need to name the directory _cpan instead of .cpan
because (by default) you can't have a directory name that has a dot in

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About