2

Whether I use CPAN or install manually, every time I try to run "perl Makefile.PL" to build a makefile for a Perl module, I get the following error:

ERROR from evaluation of Makefile.PL: Can't locate object method "new" via package "CPAN::Meta" at /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm line 1199

The CPAN::Meta module is installed, so I'm completely stumped on this one.

When run: perl -MCPAN::Meta -e1 it returns me the error:

version 0.82 required--this is only version 0.78 at /usr/lib/perl5/5.8.8/CPAN/Meta/Converter.pm line 12.

kenorb
  • 155,785
  • 88
  • 678
  • 743
Ben
  • 133
  • 1
  • 5

5 Answers5

1

It seems that when installing ExtUtils::MakeMaker, version.pm (which is bundled inside EU::MM) was not upgraded. You need to upgrade it manually. root is required for this if you don't use local::lib.

Alexandr Ciornii
  • 7,346
  • 1
  • 25
  • 29
  • version.pm says that its version number is 0.88, and I believe that is the latest version available. Does it still need to be upgraded? – Ben May 23 '11 at 19:05
  • From your error message, you have version.pm 0.78. How do you check it's version? P.S. It is possible that you have 2 variants of version.pm installed. – Alexandr Ciornii May 23 '11 at 21:19
  • I think you're right. It looks like I also have an older version in /usr/lib64/. Why would modules in /usr/lib/ reference files in lib64? Are some of them just symbolic links to the 64 bit versions? – Ben May 25 '11 at 02:25
0

If you've the error (as per comment about perl -MCPAN::Meta -e1):

version version 0.82 required--this is only version 0.78

then try upgrading it:

cpan CPAN::Meta

If you don't have access to install perl packages globally, run cpan and execute:

cpan> look CPAN::Meta

which will open a subshell in a distribution's directory, so you can download CPAN tar.gz manually and extract it there.

Source: Issues with installing Inline::Python

kenorb
  • 155,785
  • 88
  • 678
  • 743
0

The up to date 'version' is here: https://metacpan.org/pod/version

ExtUtils::MakeMaker contains a stripped down version which says:

This is a modified copy of version.pm 0.9909, bundled exclusively for use by ExtUtils::Makemaker and its dependencies to bootstrap when version.pm is not available.

But in the code it says: $VERSION = '7.36';

El_Tel
  • 41
  • 2
0

I just had this same problem, here is a solution with description:

I was doing a "cpan Bundle::CPAN" which failed. When I re-ran I found that cpan was now broken and I couldn't install any modules. Worst still, "perl Makefile.PL" was also dying with the same error:

Can't locate object method "new" via package "CPAN::Meta" at /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm line XXXX

When testing the CPAN::Meta module directly, I found the Parse::CPAN::Meta version was too old:
perl -MCPAN::Meta
Parse::CPAN::Meta version 1.44 required--this is only version 1.40 at /usr/lib/perl5/5.8.8/CPAN/Meta/Converter.pm line 13.

To be able to update Parse::CPAN::Meta, I had to first disable the use of CPAN::Meta in MakeMaker. I edited the file:
/usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm
And added "return 0;" after "sub _has_cpan_meta {" to make:
sub _has_cpan_meta {
return 0;

Then I was able to install Parse::CPAN::Meta as normal with "cpan Parse::CPAN::Meta". After which I confirmed CPAN::Meta was working "perl -MCPAN::Meta" and removed the "return 0" I'd added to /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm.

Hey presto, all working again :)

Hope that helps anyone else who finds this thread.

Cosmicnet
  • 389
  • 4
  • 14
-1

Try finding the location of CPAN::Meta and delete it or back it up and then try installing it again.

stevecomrie
  • 2,423
  • 20
  • 28