Subject: | Can't locate object method "unique_key" via package "XML::LibXML::Element" at lib/XML/Compile/Translate.pm line 601 |
Hello Mark Overmeer,
when I try to install XML::Compile::Schema (version 1.53) via cpan:
Show quoted text
cpan> install XML::Compile::Schema
I quickly get the following error:
t/21types.t ....... 1/175 Can't locate object method "unique_key" via package "XML::LibXML::Element" at lib/XML/Compile/Translate.pm line 601.
I downloaded XML-Compile-1.53.tar.gz from cpan, extracted the source to a directory and executed:
Show quoted text> perl Makefile.pl
> make
> make test
I can reproduce the problem. I did some research and it seems the missing sub was implemented with https://bitbucket.org/shlomif/perl-xml-libxml/commits/5f9243976573881f0232801fd99568caf9266b6d in 2013-10-24 by garfieldnate. Shortly after his new implementation the LibXML version was bumped up to 2.0107.
I'm on redhat 7 and I probably installed "perl-XML-LibXML-2.0018-5.el7.x86_64".
So it seems XML-Compile at least requires LibXML 2.0107. I installed libxml2-devel.x86_64 and XML-LibXML-2.0128 and could install XML::Compile::Schema successfully.
The latest XML-Compile that can be installed on a rhel7 based system is XML-Compile-1.44 then. There is no rpm available via yum for xml-compile so my "manual" way is the way that works.
I'm not even sure if this is a bug but perhaps the requirement could be stated more clearly in Compile.pm? Is that good practice to write "use XML::LibXML 2.0107;"?
However, if you think this isn't a bug, please close it.
Thanks,
Andreas.