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

Re: Perl, cpan Path problems



Hello,

On Sat, Jan 28, 2023 at 05:17:51PM -0500, Greg Wooledge wrote:
> 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

[…]

> 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.

Some useful knowledge for finding Perl modules on Debian is that
'::' in the module name will be replaced by '/' in the file path,
and the final file will have '.pm' on the end.

So unless Perl changes dramatically in the future, XML::Simple will
ship a file with "XML/Simple.pm" in the path, which is very amenable
to an "apt-file search".

That will still throw up a bunch of results a lot like what you got
with the apt-cache search. Out of those it's usually easy to tell
which is the one, as in Debian the Perl module package names are
currently formed of:

    'lib' + (lower cased module name with every '::' changed to '-') + '-perl'

So, in this case, libxml-simple-perl.

> 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.

"cpanminus" that I mentioned earlier will download, build, test and
install a module and all of its dependencies into a specified
directory tree so it can easily be kept separate from the system,
and updated as needed. It's very convenient, though of course not as
nice as having the packaging already done. 😀

As OP doesn't seem to be familiar enough with Perl on Debian to work
out how to find if modules are already installed or available, it
may be a bit of a leap anyway.

As you say, all the other options only get more complicated from there.

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: