Add Module to Existing Perl Installation

I’m regretting upgrading perl. I’ve spent the last two hours making myself crazy. I just installed the latest perl (5.28). I just want to add a module to it. I created an account, I configured a project, I don’t want to necessarily down load and install it all again. Is there anyway I can just add the module to what I already have??? I can’t run cpan, I can’t run ‘perl -MCPAN -e install my Module’ (ppm was sooo much more friendly…) Can someone have pity on me and tell me how I can just add a module? Or maybe the ‘For Dummies Version of using state’?

3 Likes

Hi arkane,

Ugh. That sounds unpleasant and certainly isn’t the experience we want you to have. Sorry about that!

At present, we build everything from source and then bundle it all together. The benefit is that you get clearer provenance of your bits. The drawback is that you can’t just grab individual modules (but we’re working on changing that.)

The best path forward at present is likely to just run:

state packages add <myModule>

See https://docs.activestate.com/platform/state/packages.html for a list of all the ways to add, search and remove modules from the command line.

Also, I’ll share your feedback with our product managers and see how we can improve the documentation.

Hello! I have a similar situation. I upgraded my ActiveState perl to fix a platform issue and now my existing scripts that automate our billing process stopped working.
I super frustrated with the state system, and I cannot get it to work.
I run the “state packages add Date-Manip” to add the one package I need.
I activate the state.
I run my script, and it says “Can’t locate Date/Manip.pm in @INC

Obviously I am missing out on how to make the state system work.

1 Like

Hi tomcmars,

It looks like the Platform wasn’t able to successfully build your package. Please see this post that talks about the issue you’re having: Build Error: Date-Manip 6.82 for Perl 5.28.1 on Windows

You should have received an error message when you were trying to state activate the project, but it could have been a bit cryptic so your confusion is well placed. We are actively working on improving our error messages.

In the meanwhile you can fix your project from the command line by updating your package to a working version by using these commands (make sure you cd into the folder that has the activestate.yaml in it first):

state package update Date-Manip@5.54
state pull
state activate

Let us know if you still have problems.

Unfortunately I have to agree, I’ve been a Perl user for 20+ years and whatever you guys came up with is completely ridiculous. I have a 50-line script that I was trying to port from one server to a newer one, and it happens to use the Date::Manip module.

For the life of me I can’t get it to work, and I’m not interested in wasting hours on figuring out your convoluted build system. I don’t have a problem with a sophisticated build management system, but that should be optional, something I opt into. I’m using a scripting language for a reason, because I want simple, something that runs without fuss. Otherwise I can just stick with C++ or whatever.

I’m uninstalling the latest version of Perl and going back to an old version.

All I wanted to do was run a simple script, this is sad.

2 Likes

Hey ingmarkoecher – sorry to hear you’re having issues. Can you let us know a little bit about the issues you’re having so we can address them? A few things that would be helpful?

  • What version of Perl are you using?
  • What version of Date::Manip do you need?
  • What platform are you on?
  • Did you try just running state install Date::Manip@5.54 ? That should just work – so if it’s not, we’d love to understand why so we can fix it.

Thx!

Hey @ingmarkoecher,

Thanks for letting us know what your experience has been like! I’m sorry to read that is hasn’t been good.

With Perl 5.32 at least, the experience should be very straightforward:

First, run one command in your console.

Linux
sh <(curl -q https://platform.activestate.com/dl/cli/install.sh) --activate-default ActiveState/Perl-5.32

Windows
powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/install.ps1'))) -activate-default ActiveState/Perl-5.32"

Then run:
state install Date::Manip

That’s it. Two steps (and no account needed.)

… and just to make it clearer for you or anyone following along, here’s a short, real-time demo video. The page I mention in the video is at Cross-platform, secure Perl by ActiveState - for developers and enterprise

Cheers!
–zak

A post was split to a new topic: State install does not work

I have to agree with the above comments, the move away from ppm has been a total disaster in my opinion. Moving scripts between servers used to be simple, install perl, add the necessary modules and your up and running.

Having to create accounts and build a “project online” every time I have to add a module is totally backwards and very user unfriendly. Having to rely on the State tool (which relies on certain versions of powershell is a problem of its own) to add modules is just convoluted.

I have worked with Active Perl for more than 15 years but I’m sad to say that now its time to leave and go with something else that gives back the ease of handling that was the reason I used Activestate Perl to begin with. I’ll check back in a year or so to see if you found your way back to a user friendly perl flavor. What on earth made you go this route?

Best regards
/P

Hey @pk2021,

Thanks for letting us know and I appreciate you writing that you’ll check back in.

We’ve explained our thinking here: Advanced Package Management for Perl Developers | ActiveState – does that make sense to you?

Cheers!
–zak

You folks have succeeded in making something that should be very simple very hard and convoluted instead.

Hey @isomage!

I agree that our old experience left a lot to be desired. The experience for Perl 5.32 and Python 3.9 is vastly streamlined. For example, it’s just two commands to install Perl 5.32 on Windows and to then add the popular Dancer2 module.

# It's a one-liner to install our state tool package manager and Perl 5.32
# though, being PowerShell, it's pretty long line :)
powershell -Command "& $([scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://platform.activestate.com/dl/cli/install.ps1'))) -activate-default ActiveState/Perl-5.32"

# Installing Dancer2 is pleasantly brief
state install Dancer2

Here’s an off-the-cuff video that shows the full workflow.

Cheers!
–zak

I just installed ActiveState perl v5.26.1 and believe that I’m having the same (or a similar) problem as others have reported. In my case, I’m trying to install Spreadsheet::Read, but state install Spreadsheet::Read results in

 • Searching for Spreadsheet::Read in the ActiveState Catalog x Failed
 x No results found for search term "Spreadsheet::Read", did you mean:

 - Spreadsheet-Read
 - Spreadsheet-Reader-ExcelXML
 - Spreadsheet-Reader-Format
 - Spreadsheet-ReadGnumeric
 - Spreadsheet-Read-Ingester

Run "state search Spreadsheet::Read" to see more suggestions.

Well, state search Spreadsheet::Read results in (truncated):



  Name                                               Latest Version

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Spreadsheet-Read                                   0.87                          + 84 older versions
                                                     Matching modules
                                                     └─ Spreadsheet::Read

Given that search found it, why couldn’t it be installed?

Your search shows the package name as Spreadsheet-Read, so use the command state install Spreadsheet-Read.

Thanks for the reply; however, how do I then use the package in a script? I can’t do use Spreadsheet-Read;

Put use Spreadsheet::Read;.

Well, that’s what I have been trying, but what doesn’t work, even after the recent install:
Can't locate Spreadsheet/Read.pm in @INC (you may need to install the Spreadsheet::Read module) (@INC contains: C:/Perl64/site/lib C:/Perl64/lib) at searchmyjobs.pl line 3.
(My perl statement is use Spreadsheet::Read;)

I have just successfully added the Spreadsheet::Read module to my 5.36.1. installation using the command state install Spreadsheet-Read. I confirmed it can be located by running the command perl -e "Spreadsheet::Read".

Run the command perl -V, check that it shows revision 5 version 36 subversion 1at the start, and then look for @INC (at the end) which should contain the paths to the lib folders, e.g.

C:/Perl-5.36.1/site/lib
C:/Perl-5.36.1/lib

If you have successfully installed the Spreadsheet::Read module (Spreadsheet-Read package), then there should be a Spreadsheet folder containing Read.pm in the site/lib folder.

1 Like

Well, that was interesting. It turns out that I had an older version of ActiveState Perl on my system, which didn’t get the Spreadsheet module installed. I uninstalled the older version and now things are working. Thanks for your help.

I have been able to have it working by this procedure: Where is State putting Perl modules? - #12 by suns-dp7