[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

AW: Perl, cpan Path problems



Running, meny thanks!

-----Ursprüngliche Nachricht-----
Von: Greg Wooledge <greg@wooledge.org> 
Gesendet: Samstag, 28. Januar 2023 23:18
An: debian-user@lists.debian.org
Betreff: Re: Perl, cpan Path problems

On Sat, Jan 28, 2023 at 10:47:01PM +0100, Maurizio Caloro wrote:
> also
> 
> root: ~/.cpan/build/Perl-Critic-1.148-2# perl -e "use XML::Simple "

I'm only going to focus on this ONE part of your mail, because the whole
thing is just too much for me.

Let's suppose that your goal is to write (or use) a perl script that needs
the XML::Simple package.

Debian provides many perl packages, so you have two paths to choose from
here: you can try to find the package in Debian, and use that, or you can
try to build it yourself.

On a Debian 11 system, I get this result:

unicorn:~$ apt-cache search --names-only perl xml simple
libtest-xml-simple-perl - Perl testing framework for XML data
libxml-atom-simplefeed-perl - Perl module for generation of Atom syndication
feeds libxml-libxml-simple-perl - Perl module that uses the XML::LibXML
parser for XML structures libxml-opml-simplegen-perl - module for creating
OPML using XML::Simple libxml-rss-simplegen-perl - Perl module for easily
writing RSS files libxml-simple-perl - Perl module for reading and writing
XML libxml-simpleobject-enhanced-perl - Perl module which enhances
libxml-simpleobject-perl libxml-simpleobject-libxml-perl - Simple oo
representation of an XML::LibXML DOM object libxml-simpleobject-perl -
Objectoriented Perl interface to a parsed XML::Parser tree
libxml-writer-simple-perl - simple API to create XML files

Buried in the middle of that result is the libxml-simple-perl package, which
I'm going to guess is the correct one.

Now that I know its name, I can also check its version:

unicorn:~$ apt-cache show libxml-simple-perl | grep Version
Version: 2.25-1

So, if version 2.25 of XML::Simple is acceptable, then I can simply install
that (using apt or apt-get or aptitude or whichever tool I prefer).

Your Debian 10 system may have a different version of this package, or it
might have the package under a different name, or it might not have it at
all.  That's why I showed how I discovered the name.  You can follow the
same basic steps.

If you wish to build a package from CPAN yourself (either because Debian
doesn't have the package at all, or because the package in Debian is not a
suitable version), it can get REALLY messy.  This is not the path that I
prefer.

When you download the source from CPAN and try to build it, it'll probably
spew a list of missing dependencies.  Then you have to look for each of
those missing dependencies, either as Debian packages, or as source code
from CPAN that you have to build by hand.

Each dependent package may have additional dependencies of its own,
recursively,  It's not a lot of fun.

So, anyway... long story short?  Figure out what you're actually trying to
do, and then do *only* that.  Want to run a script that uses XML::Simple?
Install libxml-simple-perl (or whatever it is on Debian 10, though it's
probably the same), and see if that's good enough.

Don't borrow trouble by looking for some all-encompassing knowledge of all
things perl/CPAN on Debian.  You don't need to know how to install every
conceivable CPAN package.  Just get the one package you need.



Reply to: