Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Using Cartons to automate module installs

by haukex (Archbishop)
on Jan 30, 2020 at 20:45 UTC ( [id://11112136]=note: print w/replies, xml ) Need Help??


in reply to Using Cartons to automate module installs

Q1) How do I create and roll out a Carton of these? (I have another machine with a new ubuntu install to test on.) Is a Carton the right tool?

If all you care about is getting the latest version of the modules, then you don't need Carton, only App::cpanminus (cpanm), because once you have a cpanfile, the command cpanm --installdeps . will install everything listed in that file. Carton is useful if you want to install specific versions of modules, to exactly replicate a module setup on a different machine. See Carton::Doc::FAQ.

Q2) How do I know whether I have all the core modules? How do I not leave it to chance?

Debian should install its perl package by default, which includes its perl-modules package. If for some reason it doesn't get installed, you can always sudo apt-get install perl. If you're building a fresh perl with e.g. perlbrew, you should be getting all core modules by default as well.

Q3) How do I take this output and instruct another machine to install this?

That particular output is suited for a Makefile.PL format. You could of course write a quick&dirty oneliner to turn it into cpanfile format:

$ scandeps.pl -R script.pl | perl -ne \ 'printf qq{requires "%s", "%s";\n}, eval'
Q4) What perl aliases do you use? What aliases in general?

The only one I personally have is alias prl='perl -wMstrict -MData::Dump', the rest I do by hand. I also have a ~/.perltidyrc and ~/.perlcriticrc.

Update: Shortened oneliner.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112136]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 13:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found