in reply to Cannot access CPAN Installs

When I install modules via CPAN, for some reason best known to itself, it installs them in "C:/Users/Chris Brown/Perl5/lib/perl5"

Sounds like local::lib, as Corion pointed out the last time you asked. Check if you've got the environment variables PERL_MB_OPT and/or PERL_MM_OPT set, which would explain why modules get installed to that path.

I have also put the path in the main progrem: use lib qw(C:/Users/Chris Brown/perl5/lib/perl5);

With that path, I believe the correct lib would be: use lib 'C:/Users/Chris Brown/Perl5/lib/perl5'; (Update: yup, confirmed with a test that a path like that should work). On Windows, and especially with multiple Perls installed, perhaps try not relying on the PERL5LIB environment variable.

If that still doesn't work, then you've got something really strange going on with your install. Are you sure you only have one Perl installed on your machine? (Again, look for any environment variables from old installs.)

Replies are listed 'Best First'.
Re^2: Cannot access CPAN Installs
by tobyink (Canon) on Dec 05, 2019 at 09:21 UTC

    Just pointing out an important difference between the following:

    use lib qw(C:/Users/Chris Brown/perl5/lib/perl5); use lib 'C:/Users/Chris Brown/Perl5/lib/perl5';

    The qw(...) syntax will split the string on whitespace and turn it into a list. So the first line is equivalent to:

    use lib ( 'C:/Users/Chris', 'Brown/perl5/lib/perl5' );

    And that is not what you want. haukex correctly uses quotes for the path and that is why it works for him.

Re^2: Cannot access CPAN Installs
by cristofayre (Sexton) on Dec 06, 2019 at 17:32 UTC

    VERY RED FACED ...

    Seems I have (at least) TWO versions of PERL on computer -maybe three! And when I go to CMD and enter "cpan", it loads the module relating to the Perl5 install that I did at some time, which resides in my user profile as stated above. What I SHOULD have done is gone to start menu, Strawberry Perl folder, and used the cpan module within that folder ! (Sorry, everyone!)

    But ... I've also found I have "C:/usr/perl/bin" - the same as the shebang ... which I thought was the one running ... but maybe not. I thought I would rename it, the theory being if 'redundant' and really using Strwaberry, the name change would go un-noticed. But ... (lots of 'buts') it reports that it is in use by another program, and cannot be changed. Which MUST mean it's being lauched at startup! Somehow

    Been to the startup folder in Users, but that only shows a few programs that are started up by choice. Tried the C:startup, and that has a lot of files, including Apache Monitor, (which doesn't start as no icon shown; properties says it has come from another computer, and has a block on it), makefile and similar. But nowehere can I see any entries that are loading "C:/usr/perl/bin"

    So,whilst not related to original question, how can I 'stop' usr/perl/bin so I can delete it?

    Of interest, here are my full paths:

    C:\Program Files (x86)\Common Files\Oracle\Java\javapath; C:\ProgramData\Oracle\Java\javapath; C:\usr\site\bin; C:\usr\bin; C:\Perl64\site\bin; C:\Perl64\bin; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static; C:\Users\Chris Brown\AppData\Local\Smartbar\Application\; C:\Users\Chris Brown\AppData\Local\Smartbar\Application\; C:\Strawberry\c\bin; C:\Strawberry\perl\site\bin; C:\Strawberry\perl\bin; C:\PHP; C:\Program Files (x86)\QuickTime\QTSystem\; C:\usr\c\bin; C:\usr\perl\site\bin; C:\usr\perl\bin; C:\Users\CHRISB~1\perl5\bin

    (Looking at that, maybe PERL64 needs to go as well... and they're not even shown in programs/control panel to delete that way!) Oh, and one final point. Despite having the "notify me when someone replies to my post", I never get any notifications to the email address - which is correct

      it reports that it is in use by another program

      Process Explorer from Microsoft SysInternals is your friend. It allows for searching for what processes/DLLs have a file open (Ctrl+F, enter the search string), and for executables shows the hierarchy of comands. For example, when I run perl from Notepad++'s NppExec plugin, so it's in a little command shell, it shows the notepad++.exe > perl.exe call-chain: https://i.imgur.com/3CczLaH.png

      how can I 'stop' usr/perl/bin so I can delete it?

      you can kill any perl.exe using Task Manager or Process Explorer. If you're trying to stop the process that has a file or folder open, after searching in Process Explorer, it will tell you the PID of the process that has it open, so you can use Process Explorer or Task Manager to kill the process that's holding it open.

      edit:

      I never get any notifications to the email address

      Notifications go to your PerlMonks Message Inbox, not to your email. Perlmonks was designed to not send any email (except maybe a welcome email -- I don't remember for sure -- and your plaintext password when you request a password reset).