[KLUG Members] Best place to find/download perl modules...

Jamie McCarthy members@kalamazoolinux.org
Wed, 5 May 2004 11:46:17 -0400


adam@morrison-ind.com (Adam Tauno Williams) writes:

> > > seems less destructive than using cpan (nothing runs
> > > off an compiles anything).
>
> > 'splain that one to me please.  Why in the world would
> > acquiring/installing new perl modules require compiling?  I
> > thought perl modules were basically just scripts...
> 
> Beats me,  install some packages via cpan and just watch the
> spider-web of events that can ensue.  The "why" is pretty much
> left up to you to decipher from not terribly lucid messages and
> package names.

Some Perl modules include code in other languages, usually C, usually
for speed.  For example, Storable, the module that serializes data
structures, would be a bunch slower if it were pure perl;  since its
core is in C, it can grab perl's own data structures directly.

But XS modules are not a big deal;  usually, it Just Works (tm).
What you're probably talking about is the often-lengthy install
process when a module requires other modules.  CPAN will update all
your installed modules recursively, which can dump a lot of junk
onto your console as it runs through fifty Makefiles, including a
full suite of tests.

I don't consider this a problem, since I usually keep all my modules
up to date every week.  But if you use a package management system,
it probably has a different (older) idea of what the "current stable"
version of a module is, than does CPAN, so when you run CPAN,
updating any module may update a large number of modules.  And,
annoyingly, the next time your package management system decides it
needs to upgrade a perl module, it may actually downgrade it from
what the CPAN had installed (Debian does this).

If you do heavy perl coding, it's worth using CPAN to keep your
modules up-to-date -- every so often, you'll think "I bet someone
else has coded a solution for this problem already" and ten minutes
later you will get that glow of joy when you realize some obscure,
open-source, reusable code just saved you three days' work.  If you
need to install obscure modules, usually your package management
system will fail, because its maintainers have probably only covered
the 200 most commonly used perl modules.

But if you don't code in perl, ignore CPAN, use packages.

BTW, the module called CPAN.pm is old, creaky, and in the process of
being replaced;  my hope is that CPANPLUS.pm, which is being groomed
to take over, will be smarter about all this.
-- 
  Jamie McCarthy
 http://mccarthy.vg/
  jamie@mccarthy.vg