I've installed a number of modules into my Strawberry Perl running on Windows XP, such as:
- Regexp::Common
- URI::Find::Schemeless
These libraries work fine in my perl code the first time directly after installing each module.
The problem is that every subsequent day I run my scripts they fail with the error:
Can't locate Regexp/Common.pm in @INC (@INC contains: C:/strawberry/perl/lib C:/ strawberry/perl/site/lib C:\strawberry\perl\vendor\lib .)
I have put all the appropriate paths into environment variables into Windows: PERL5LIB and others such as lib that were suggested on various other answers on stackoverflow and other wesites dealing with module installations. The scripts continue to fail unless I perform the following workaround that I figured out:
- Open the "edit the environment variables" window in Windows. ("My Computer" -> "Properties" -> "Advanced" tab -> "Environment Variables")
- Without adding or changing anything, click OK.
- Re-open any perl consoles that were already open or open a new perl window.
- Now the libraries are all found without issues.
Does anyone have an idea why this might be happening? I suspect it may be something specifically related to Windows/cmd or even my company's windows environment setup?
Any suggestions would be appreciated because it is an extremely annoying problem!