Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Perl, cpan Path problems

174 views
Skip to first unread message

Maurizio Caloro

unread,
Jan 28, 2023, 4:50:06 PM1/28/23
to

Hello

 

Here iam running with Debian 10.13, and please i need little Support

 

 

-

 

i think me cpan and perl have any problems, please what are the right path for PERL_LIB?`

how i can reinstall cpan or Perl so that i can install Cpan/Perl packages?

 

this always i have executed

> $ cpan o conf init

 

thanks for any possible help

root ~/.cpan/build/Perl-Critic-1.148-2# cpan Perl::OSType

Loading internal logger. Log::Log4perl recommended for better logging

Reading '/root/.cpan/Metadata'

  Database was generated on Sat, 28 Jan 2023 18:54:01 GMT

Running install for module 'Perl::OSType'

Checksum for /root/.cpan/sources/authors/id/D/DA/DAGOLDEN/Perl-OSType-1.010.tar.gz ok

'YAML' not installed, will not store persistent state

The content of '/root/.cpan/build/Perl-OSType-1.010-1/META.yml' is not a HASH reference. Cannot use it.

Configuring D/DA/DAGOLDEN/Perl-OSType-1.010.tar.gz with Makefile.PL

Checking if your kit is complete...

Looks good

 

Warning: PERL_LIB (/usr/share/perl/5.28) seems not to be a perl library directory

        (strict.pm not found) at /etc/perl/ExtUtils/MM_Unix.pm line 1948.

 

Generating a Unix-style Makefile

Writing Makefile for Perl::OSType

  DAGOLDEN/Perl-OSType-1.010.tar.gz

  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK

Running make for D/DA/DAGOLDEN/Perl-OSType-1.010.tar.gz

The content of '/root/.cpan/build/Perl-OSType-1.010-1/META.yml' is not a HASH reference. Cannot use it.

Could not read metadata file. Falling back to other methods to determine prerequisites

cp lib/Perl/OSType.pm blib/lib/Perl/OSType.pm

Manifying 1 pod document

  DAGOLDEN/Perl-OSType-1.010.tar.gz

  /usr/bin/make -- OK

Running make test for DAGOLDEN/Perl-OSType-1.010.tar.gz

PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

Can't locate Benchmark.pm in @INC (you may need to install the Benchmark module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/local/share/perl/5.28.1/TAP/Parser/Aggregator.pm line 5.

BEGIN failed--compilation aborted at /usr/local/share/perl/5.28.1/TAP/Parser/Aggregator.pm line 5.

Compilation failed in require at /usr/local/share/perl/5.28.1/Test/Harness.pm line 12.

BEGIN failed--compilation aborted at /usr/local/share/perl/5.28.1/Test/Harness.pm line 12.

Compilation failed in require.

BEGIN failed--compilation aborted.

make: *** [Makefile:778: test_dynamic] Error 2

  DAGOLDEN/Perl-OSType-1.010.tar.gz

  /usr/bin/make test -- NOT OK

//hint// to see the cpan-testers results for installing this module, try:

  reports DAGOLDEN/Perl-OSType-1.010.tar.gz

root@ ~/.cpan/build/Perl-Critic-1.148-2#

 

--

 

root:~/.cpan/build/Perl-Critic-1.148-2# cpan install XML::Simple

Loading internal logger. Log::Log4perl recommended for better logging

Reading '/root/.cpan/Metadata'

  Database was generated on Sat, 28 Jan 2023 18:54:01 GMT

Running install for module 'XML::Simple'

Fetching with HTTP::Tiny:

https://cpan.org/authors/id/G/GR/GRANTM/XML-Simple-2.25.tar.gz

Fetching with HTTP::Tiny:

https://cpan.org/authors/id/G/GR/GRANTM/CHECKSUMS

Checksum for /root/.cpan/sources/authors/id/G/GR/GRANTM/XML-Simple-2.25.tar.gz ok

'YAML' not installed, will not store persistent state

The content of '/root/.cpan/build/XML-Simple-2.25-0/META.yml' is not a HASH reference. Cannot use it.

Configuring G/GR/GRANTM/XML-Simple-2.25.tar.gz with Makefile.PL

Checking if your kit is complete...

Looks good

Warning: PERL_LIB (/usr/share/perl/5.28) seems not to be a perl library directory

        (strict.pm not found) at /etc/perl/ExtUtils/MM_Unix.pm line 1948.

Generating a Unix-style Makefile

Writing Makefile for XML::Simple

  GRANTM/XML-Simple-2.25.tar.gz

  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK

Running make for G/GR/GRANTM/XML-Simple-2.25.tar.gz

The content of '/root/.cpan/build/XML-Simple-2.25-0/META.yml' is not a HASH reference. Cannot use it.

Could not read metadata file. Falling back to other methods to determine prerequisites

cp lib/XML/Simple/FAQ.pod blib/lib/XML/Simple/FAQ.pod

cp lib/XML/Simple.pm blib/lib/XML/Simple.pm

Manifying 2 pod documents

  GRANTM/XML-Simple-2.25.tar.gz

  /usr/bin/make -- OK

Running make test for GRANTM/XML-Simple-2.25.tar.gz

PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

Can't locate Benchmark.pm in @INC (you may need to install the Benchmark module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /usr/local/share/perl/5.28.1/TAP/Parser/Aggregator.pm line 5.

BEGIN failed--compilation aborted at /usr/local/share/perl/5.28.1/TAP/Parser/Aggregator.pm line 5.

Compilation failed in require at /usr/local/share/perl/5.28.1/Test/Harness.pm line 12.

BEGIN failed--compilation aborted at /usr/local/share/perl/5.28.1/Test/Harness.pm line 12.

Compilation failed in require.

BEGIN failed--compilation aborted.

make: *** [Makefile:782: test_dynamic] Error 2

  GRANTM/XML-Simple-2.25.tar.gz

  /usr/bin/make test -- NOT OK

//hint// to see the cpan-testers results for installing this module, try:

  reports GRANTM/XML-Simple-2.25.tar.gz

root:~/.cpan/build/Perl-Critic-1.148-2#

 

also

root: ~/.cpan/build/Perl-Critic-1.148-2# perl -e "use XML::Simple "

Can't locate XML/Simple.pm in @INC (you may need to install the XML::Simple module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at -e line 1.

BEGIN failed--compilation aborted at -e line 1.

root@nmail:~/.cpan/build/Perl-Critic-1.148-2#

 

 

 

 

 

 

Greg Wooledge

unread,
Jan 28, 2023, 5:20:06 PM1/28/23
to
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.

Andy Smith

unread,
Jan 28, 2023, 5:20:06 PM1/28/23
to
Hi,

On Sat, Jan 28, 2023 at 10:47:01PM +0100, Maurizio Caloro wrote:
> root ~/.cpan/build/Perl-Critic-1.148-2# cpan Perl::OSType

Firstly, v1.010 of Perl::OSType is already included in default
Debian perl installs on Debian 10 (buster) and in fact that is the
latest version oif that module, so why are you trying to also
install it from CPAN? It will not give you a newer version of that
module.

$ perl -MPerl::OSType -E 'say $Perl::OSType::VERSION'
1.010

Secondly, once you do come to need some non-included Perl module (or
a newer version of an included one), you'll have an easier time
using "cpanminus", which you can install as a Debian package. After
you've done that:

# cpanm --local-lib=/path/to/your/libs Whatever::Module

This will then download, build and install Whatever::Module (and any
dependencies) into /path/to/your/libs/.

"cpanminus" is much nicer to use than "cpan". See its web page at
https://metacpan.org/pod/App::cpanminus for full details.

Cheers,
Andy

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

Maurizio Caloro

unread,
Jan 28, 2023, 6:00:07 PM1/28/23
to
Running, meny thanks!

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

Andy Smith

unread,
Jan 28, 2023, 6:22:26 PM1/28/23
to
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.
0 new messages