in reply to Re: Using Cartons to automate module installs
in thread Using Cartons to automate module installs
Q2) How do I know whether I have all the core modules? How do I not leave it to chance?Why do you care?
I suspect it's because the first paragraph of the Carton docs is:
Carton only works with perl installation with the complete set of core modules. If you use perl installed by a vendor package with modules stripped from core, Carton is not expected to work correctly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using Cartons to automate module installs
by Aldebaran (Curate) on Feb 04, 2020 at 17:52 UTC | |
You were exactly right, and while the absense of core modules might be problematic for a Carton, it is immaterial to a cpanfile, which, after a ton of reading about it, seems to suit my needs fine. I have been trying to implement them in varying ways and find success in a bash script that relies on scandeps.pl . It seems to me that it invites disaster to compose a cpanfile by hand, never mind the tedium. It has to be named 'cpanfile' for the command sudo cpanm --installdeps . to work. There has been a fair amount of evolution in these matters over the years, so newer sources of information are more reliable. I found these html pages helpful and up to date: specifying-dependencies-for-your-cpan-distribution and introduction-to-distribution-metadata. The bash script wraps the invocation of scandeps.pl, creating a directory to house the files to be scanned and the resulting cpanfile. I also get a "paper trail" for what happens on STDOUT with | tee -a "$out" . Here is sample output:
Source:
So, yay, that I'm getting results, but I don't quite understand the line of code I'm using to get them. Can you "talk through" what happens on this line, in particular, how the %s's get populated? scandeps.pl -R *.pl | perl -ne 'printf qq{requires "%s", "%s";\n}, eval'Thank you for your comments. | [reply] [d/l] [select] |
by haukex (Archbishop) on Feb 04, 2020 at 18:35 UTC | |
So, yay, that I'm getting results, but I don't quite understand the line of code I'm using to get them. Can you "talk through" what happens on this line, in particular, how the %s's get populated? Sure: It seems to me that it invites disaster to compose a cpanfile by hand, never mind the tedium. Personally, I don't think so - note that the output of scandeps.pl can sometimes be a lot more verbose than it needs to be. I think it's better to get an understanding of what the module dependency tree looks like instead of blindly relying on the tool - I usually try to keep track of which CPAN dependencies I add to my scripts, and I only use scandeps.pl to get hints whether I may have missed something. Note that in the output you showed, all the the ExtUtils::MM_* modules can probably be omitted, and also ExtUtils::MakeMaker and File::Temp are core modules, meaning that unless your script requires a certain new version of them, they usually don't need to be listed. | [reply] [d/l] [select] |
by Anonymous Monk on Feb 05, 2020 at 01:18 UTC | |
String eval? Eeeeeew :)
| [reply] [d/l] [select] |