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.

1 Like

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.

3 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 https://www.activestate.com/perl-532/

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