I have just upgraded from Perl 5.16.003 to 5.28.1. So, I just found out that PPM has been replaced with State. Unfortunately, I can’t quite figure out what State is doing. I have installed DBD-mysql. State says that the install was successful. Perl can’t find it.
install_driver(mysql) failed: Can’t locate DBD/mysql.pm in @INC (you may need to install the DBD::mysql module) (@INC contains: . C:/Perl64/site/lib C:/Perl64/lib)
(Yes, that is a dot. Yes, I put it there. Yes, I read the reasons why I should not have before I did.)
I would expect to find mysql.pm in c:/Perl64/site/lib/DBD, but it isn’t there.
So where did State put it? How do I tell State to put it in c:/Perl64/site/lib/DBD? I’m stuck, unable to work until I can figure this out.
I’m on Windows 8.1.
I found a copy of mysql.pm in C:\Users\Owner\AppData\Local\ActiveState\bd66a537\site\lib\DBD. Why did State put it there? Is this its permanent home? Why isn’t it in c:/Perl64/site/lib/DBD?
It appears that the location of the module has something to do with a project that I had to create to use State. I don’t want to work within a project. I just want Perl running on my machine. Now I have 2 copies of Perl 5.28 on my machine, one copy where State is loading modules, and another copy where the OS expects to find Perl. This is a mess! I just want 1 copy of Perl on my machine where the OS can find it, and all of the modules installed in that location.
Is any of this documented so someone like me can figure out what the hell is going on?
I have removed c:/Perl64, where I had Perl 5.28 installed, from my Path, so I can go back to 5.16 and actually use Perl.
If it makes a difference, I used the .msi file to install Perl 5.28. Do I need to uninstall Perl, and re-install using State? But if I uninstall Perl 5.28, won’t I lose State when I do, since it isn’t part of Perl 5.16?
There is no mechanism to add modules to deployed ActivePerl builds that have not been installed with the State Tool. The mechanism to add modules is to build a new installer, and replace the deployed
So, what does this mean as far as installing modules? Does State do an entire rebuild of Perl every time a new module is installed? Does the new build replace the old one? Is there a way to re-install all modules installed for an earlier version of Perl all at once? Is any of this documented anywhere?
I found the docs. I am starting to make sense of the new paradigm. I will just say that my first impression is that the new paradigm is a pain in the butt for those of us who are still maintaining legacy code that uses CGI.pm or hack together scripts for our personal use on our local machines.
Hi Sbryce! Certainly appreciate the effort you’ve put into learning how to use the state tool. To say the version you’re using is rough around the edges would be an understatement. There is a new version due any day now that will adress many of your concerns.
Our focus up until recently has been to get our cloud based cross platform dependency and build farm up to snuff. Now though you should start seeing us make some drastic improvements to the usability of the command line tool.
For instance some of the issues we’ve addressed in the upcoming release include:
Streamlined UX for those that want to use us for vanilla package management (works anonymously as well!)
Ensuring we’re installing in a reasonable place
Hiding the complexity of our Virtual Environment Features if you aren’t taking advantage of it
That being said we certainly want to make this the best experience for you even if you’re maintaining legacy code. So if there’s certain features you need or enhancements let us know!
Will we be contacted when the new version comes out? It looks like it will address some of my concerns. Otherwise, I can come up with a reasonable workaround. For now, I am working in 5.16.003, and can continue to do so until the new version comes out.
I found a copy of mysql.pm in C:\Users\Owner\AppData\Local\ActiveState\bd66a537\site\lib\DBD. Why did State put it there? Is this its permanent home? Why isn’t it in c:/Perl64/site/lib/DBD?
On Windows, the State Tool installs all downloaded files relative to the <AppData> directory that you found. As you have already figured out, these files are bound to the project that you created to use the State Tool. You can “activate” into an environment where that perl installation is available when running state activate, or when running pre-configured scripts with state run.
The State Tool can be installed independently of any global Perl installation. So, you can use your Perl 5.28 project and the global Perl 5.16 installation. That is the benefit of the State Tool creating virtual environments that co-exist next to each other.
Hi everyone. I installed 5.28 today on a new machine and I’m having exactly the same problems as sbryce. Thanks sbryce for the perseverance. At least I can use -I or “set PERL5LIB” to use my old code.
On my Windows 11 machine I had to restart my Console window to have it running finely.
It was reading the path from another folder in c:/Users/administrator/AppData/Local/activestate/cache/ where there is not just one. It’s possible to see which one contains the module folders needed, as you would have already been installing some by state install <Module-Name>
Then when I have been running perl -V I can now see the right paths on @INC variable on the bottom of that list.
I was able to create a Windows Environment Variable too with the simplest procedure by the GUI on Windows it is so possible to just add a new variable called PERL5LIB containing the string of the path of the right module directory. I wasn’t needing it in the end in any case.