DugganSC has asked for the wisdom of the Perl Monks concerning the following question:

I am a Perl newbie who decided to try parsing XML using the code and suggested libraries from this tutorial. I am having issues including libraries such as XML::TreeBuilder and HTML::TreeBuilder. I downloaded the code from CPAN (due to various issues with the computers at work, I cannot use "ppm") and put it in the correct directory, but when I try to compile either the Makefile.pl, I get the following error:

C:\Temp\TreeBuilder\XML-TreeBuilder-3.09>perl MakeFile.PL Warning: prerequisite HTML::Element failed to load: HTML::Parser objec +t version 3.26 does not match bootstrap parameter 3.66 at C:/Perl/lib +/DynaLoader.pm line 25. Compilation failed in require at C:/Perl/site/lib/HTML/Entities.pm lin +e 79. Compilation failed in require at C:/Perl/lib/HTML/Element.pm line 15. BEGIN failed--compilation aborted at C:/Perl/lib/HTML/Element.pm line +15. Compilation failed in require at (eval 4) line 3. Writing Makefile for XML-TreeBuilder

I get a similar error message when I try to compile simple code like:

#!/usr/bin/perl -w # # Perform skeleton remapping for given mesh # use XML::TreeBuilder; my $file = $ARGV[0]; my $tree = XML::TreeBuilder->new(); $tree->parse_file($file);

I'm sure I'm missing something obvious here... could anyone enlighten me?

Replies are listed 'Best First'.
Re: Bootstrap Version Issues including HTML and XML libraries
by marto (Cardinal) on Aug 27, 2010 at 16:54 UTC
    HTML::Element failed to load: HTML::Parser object version 3.26 does not match bootstrap parameter 3.66

    The module you are trying to install has a list of dependencies, it looks as though the version of HTML::Parser isn't being satisfied.

    What does c:\perl -v output? I'd suggest installing an up to date version of Strawberry Perl and use the cpan command line client to install modules since you can't use PPM. See also Installing Modules from the tutorials section.

      Ah. I'm limited in what I can install. This is on a computer at work. The version info I receive is the following (-v followed by -V since it said that was necessary to show the "one patch")

      This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 635 provided by ActiveState Corp. http://www.ActiveState. +com Built 15:34:21 Feb 4 2003 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge. Summary of my perl5 (revision 5 version 6 subversion 1) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=define useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='cl', ccflags ='-nologo -O1 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE + -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLIC +IT_SYS -DPERL_MSVCRT_READFIX', optimize='-O1 -MD -Zi -DNDEBUG', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=4 alignbytes=8, usemymalloc=n, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"C:\Perl\lib\CORE" -machine:x86' libpth="C:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netap +i32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.li +b odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib n +etapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc3 +2.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEX +T PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 635 Built under MSWin32 Compiled at Feb 4 2003 15:34:21 @INC: C:/Perl/lib C:/Perl/site/lib .

        That's a pretty old version of Perl. Consider speaking to your system administrator and suggesting the upgrade. Given that you seem to be able to download modules manually and install them they can't be too objectionable.

Re: Bootstrap Version Issues including HTML and XML libraries
by syphilis (Archbishop) on Aug 28, 2010 at 08:23 UTC
    You have a botched installation of HTML::Parser. Re-installing HTML::Parser will fix that problem (so long as the re-installation is done correctly).

    Alternatively, if you replace your current version (3.66) of HTML/Parser.pm with version 3.26 of HTML/Parser.pm, that too should take care of that particular problem.

    Better, of course, to upgrade your perl - as already suggested.

    Cheers,
    Rob