mikejones has asked for the wisdom of the Perl Monks concerning the following question:

I am running this command:
$ perl -MCPAN -e 'install Bundle::CPAN;'
and it hangs on the taint check. So I tried it manually and was receiving permission denied errors. See the bottom.
$ perl -V Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=cygwin, osvers=1.5.18(0.13242), archname=cygwin-thread-mult +i-64int uname='cygwin_nt-5.1 inspiron 1.5.18(0.13242) 2005-07-02 20:30 i68 +6 unknown unknown cygwin ' config_args='-de -Dmksymlinks -Duse64bitint -Dusethreads -Uusemyma +lloc -Doptimize=-O3 -Dman3ext=3pm -Dusesitecustomize'
snip
Checking if your kit is complete... Looks good Writing Makefile for Cwd CPAN: YAML loaded ok (v0.65)
snip
chmod 644 blib/arch/auto/Cwd/Cwd.bs KWILLIAMS/PathTools-3.25.tar.gz /usr/bin/make -- OK Running make test /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/crossplatform....ok 7/50 skipped: various reasons t/cwd..............ok t/Functions........ok t/rel2abs2rel......ok t/Spec.............ok 90/491 skipped: various reasons t/taint............
$ make install Warning: You do not have permissions to install into /usr/lib/perl5/5.8/cygwin at /usr/lib/perl5/5.8/Ex tUtils/Install.pm line 114. Cannot forceunlink /usr/lib/perl5/5.8/cygwin/auto/Cwd/Cwd.dll: Permission denied at /usr/lib/perl5/5.8/ File/Find.pm line 907 make: *** [pure_perl_install] Error 13
Any help or ideas? thank you

Replies are listed 'Best First'.
Re: updating Bundle::CPAN issues
by shigetsu (Hermit) on Jul 06, 2007 at 18:26 UTC

    First of, you shouldn't run the CPAN shell update as user, but as super-user (root) - that should at least not give you permission errors while trying to install the relevant bits.

    Are you sure "t/taint" is hanging or just taking some time to complete? What happens if you try 'force install Bundle::CPAN' within the CPAN shell?

      The super-user thing is generally true, except that you can do a local-user-only install of Cygwin.
Re: updating Bundle::CPAN issues
by randyk (Parson) on Jul 06, 2007 at 18:33 UTC
    The same sort of problem arises with ActivePerl, I think because the dll is in use at the time. What works there is to manually delete (or move out of the way) /usr/lib/perl5/5.8/cygwin/auto/Cwd/Cwd.dll and do a make install again.

      yes. I am currently building a solution to generate periodically a cygperl distrib with **a lot** of extra modules and I came across this problem which breaks badly (sadly) the CPAN toolchain.

    • it seems windows is using some kind of cache and even if the perl executable does an unload-reload of a given dll (using I guess the one in the local install dir), windows gives an error or maybe the unload mechanism does not work on cygwin...(or windows)
    • one fix is check blib for *dll and move the dll to .RM and generate a (rm) script to run at exit
    • a better one would be to fix EU::MM for cygwin, or replace the equivalent to the "install" cmd with a smarter equivalent
    • cheers --stephan
Re: updating Bundle::CPAN issues
by mrpeabody (Friar) on Jul 07, 2007 at 04:46 UTC
    On Cygwin, CPAN can't be upgraded while it is running. It should give a Cygwin-specific warning during the install procedure. The workaround is quitting CPAN and doing the make-test-install dance from the command line.

    If you still get "can't unlink" errors, rename the dll and try again. Doing this from within Perl might be a challenge.