in reply to use XML::LibXML; is causing compile error
I tried it myself this morning.
Only code:
use XML::LibXML;Result:
Can't locate XML/LibXML/Common.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at :/Perl/site/lib/XML/LibXML.pm line 12.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/LibXML.pm line 12.
Compilation failed in require at test_LibXML.pl line 3.
BEGIN failed--compilation aborted at test_LibXML.pl line 3.
This is the line in LibXML.pm that causes the error:
use XML::LibXML::Common qw(:encoding :libxml);
Which is not surprising of course. I looked in C:\Perl\site\lib\XML\LibXML and the Common.pm is (of course) missing. Apparently the ppm package for Win32 from ActiveState is flawed.
Next I installed the ppm for Common separately. This took care of the problem.... but then the next problem popped up:-(
UpdateCode used (taken from the pod)
use strict; use warnings; use XML::LibXML; my $parser = XML::LibXML->new; open my $fh, "dHarry.xml"; binmode $fh; # drop all PerlIO layers possibly created by a use open + pragma my $doc = $parser->parse_fh($fh); open my $out, "out.xml"; binmode $fh; # as above $doc->toFh($fh); # or print $fh $doc->toString();
Error message: Can't locate object method "toFh" via package "XML::LibXML::Document". Which makes a lot of sense since the sub is not in LibXML.pm where it should be. This wrong as it was added in v1.53 and my version is 1.66.
The ppm package from ActiveState is buggy. As an alternative you can try build it from the CPAN distribution or find another Win32 ppm package for it.
Update 2Submitted the bug to ActiveState.
Update 3I tried the trouchelle ppm package. First you have to install Common separately because it's not present on trouchelle. The code above gives the following error message:
Can't load 'C:/Perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XM +L::LibXML: load_file:The specified procedure could not be found at C: +/Perl/lib/DynaLoader.pm line 230. at C:/Perl/site/lib/XML/LibXML.pm line 116 BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/LibXML.pm li +ne 116. Compilation failed in require at C:/workspace/XML/test_LibXML.pl line +4. BEGIN failed--compilation aborted at C:/workspace/XML/test_LibXML.pl l +ine 4.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use XML::LibXML; is causing compile error
by Anonymous Monk on Aug 21, 2008 at 08:31 UTC | |
|
Re^2: use XML::LibXML; is causing compile error
by syphilis (Archbishop) on Aug 21, 2008 at 11:24 UTC | |
by dHarry (Abbot) on Aug 21, 2008 at 12:04 UTC | |
by syphilis (Archbishop) on Aug 21, 2008 at 12:35 UTC | |
by dHarry (Abbot) on Aug 21, 2008 at 12:46 UTC | |
by syphilis (Archbishop) on Aug 21, 2008 at 13:15 UTC |