"cloning" perl / CPAN install

W

Walter Roberson

I maintain perl installations (often with several different revisions
simultaneously) on multiple computers. As I find I need a CPAN
module (or it looks like it is of interest and I want to read the
documentation for it), I install the module on one system; and then
might end up writing code using that module. At some later point,
I want to bring the other computers in sync with the module set.
If I happen to remember everything I've installed, well and good, but
usually I don't.

Would then, there happen to be a good way to say "install all the
CPAN modules from this version here, to that version over there?"
Presuming that there might be different architectures or versions involved
(e.g., the module :: name is important moreso than copying
the distribution)?

Or perhaps to make this simpler: is there an easy way to figure
out which CPAN modules top-level modules have been installed,
in a form suitable for pasting in to a CPAN 'install' statement
on another machine (or different version)? I made an attempt at
this by looking through the directory the modules get installed into,
but that directory has system modules as well, and if I just chase
down the directory finding all the .pm's and converting /'s to ::
then I end up trying to install sub components of modules rather than
just getting the official module name that includes all the subcomponents.

cpan itself must have a way of doing this, in order to impliment the
'r' command, but I'd perfer not to have to dig through cpan source
if someone happens to know the answer. (Surely this same functional
requirement happens to many other people as well.)
 
S

Sherm Pendley

Walter said:
cpan itself must have a way of doing this

The "autobundle" command in the CPAN shell.
I'd perfer not to have to dig through cpan source

Did you also prefer not to have to dig through the "help" command?

sherm--
 
W

Walter Roberson

:> cpan itself must have a way of doing this

:The "autobundle" command in the CPAN shell.

Thanks, I'll have a look at that.


:> I'd perfer not to have to dig through cpan source

:Did you also prefer not to have to dig through the "help" command?

It so happens that I'd scrolled through the entire cpan source already
once today, just a short time before, in order to answer another
poster's question about where exactly perl -MCPAN -e shell was
documented. I saw at that time that the cpan source was long and involved,
and would require hours of careful study in order to figure out
a clean way to do it from the cpan source. The remark was not one
of laziness: it was based upon having -already- looked and having seen
that the matter would be complex to work out.

As for your reference to the "help" command: here is what the help
menu says about autobundle as of perl 5.8.3:

[...]
autobundle Snapshot force cmd unconditionally do cmd
cpan> help autobundle
Detailed help not yet implemented


A remark: I "hang out" in a diverse set of technical newsgroups, and I
spend a fair bit of time contributing to those newsgroups, in
accordance to my knowledge, skills, and strengths. Even in this
newsgroup itself, before posting my question, I answered several
questions, and did a longish piece about parsing efficiency and finite
automata -- time spent trying to incrase people's understandings of
both the issue and the potential technical solutions. I "give" what I
can, and I have done so for many years. It thus seems to me not unfair
for me to occasionally recognize that some questions do not lie within
my strengths, and to pose the questions publically to be [if I am
fortunate] answered by someone who already knows the answer. The
person who answers does so based upon -their- strengths, and I'm left
more time to answer questions that fit in with -my- strengths.

Is my thinking on this matter wrong? Is that the true meaning of
Open Source -- that because one -can- read the source, that one
has a moral obligation to answer every question by oneself, no matter
how long it is likely to take, and no matter how much doing so is likely
to diminish one's time available for volunteering to help others?
 
S

Sherm Pendley

Walter said:
poster's question about where exactly perl -MCPAN -e shell was
documented.

perldoc CPAN.pm
As for your reference to the "help" command: here is what the help
menu says about autobundle as of perl 5.8.3:

[...]
autobundle Snapshot force cmd unconditionally do
cmd
cpan> help autobundle
Detailed help not yet implemented

Yep, I was too quick on the trigger this time. Sorry. :-(

The documentation as it stands is pretty bad; 'perldoc CPAN' gets you a
*very* terse description of the 'cpan' command from the POD docs
in /usr/bin/CPAN. Using 'perldoc CPAN.pm' instead will get you the older,
much more thorough, documentation found in the module.

sherm--
 
J

Joe Smith

Walter said:
:> I'd perfer not to have to dig through cpan source

:Did you also prefer not to have to dig through the "help" command?

It so happens that I'd scrolled through the entire cpan source already
once today, just a short time before, in order to answer another
poster's question about where exactly perl -MCPAN -e shell was
documented. I saw at that time that the cpan source was long and involved,

I try to make it a habit of using perldoc on the module before looking
at the source code. You'll often find important stuff on the first
page that way.

If you had done
perldoc CPAN
before going to
less /usr/lib/perl5/5.8.3/CPAN.pm
you could have saved a lot of wear and tear on your brain.

-Joe
 
W

Walter Roberson

:> It so happens that I'd scrolled through the entire cpan source already
:> once today, just a short time before, in order to answer another
:> poster's question about where exactly perl -MCPAN -e shell was
:> documented. I saw at that time that the cpan source was long and involved,

:I try to make it a habit of using perldoc on the module before looking
:at the source code. You'll often find important stuff on the first
:page that way.

:If you had done
: perldoc CPAN
:before going to
: less /usr/lib/perl5/5.8.3/CPAN.pm
:you could have saved a lot of wear and tear on your brain.

Actually what I did was perldoc -m CPAN which somehow I had
come to understand was the way one had to ask for documentation
about a module with the given name. I see now looking at the man
page that I did not need the -m to get to the documentation. Oh well,
too late now to worry about how I formed the -m bad habbit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top