473,416 Members | 1,628 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Neophyte having trouble Installing XML::Parser module on OS X

Environment: Mac OS X (10.4.10) on MacBook Pro

I'm a Perl Neophyte. I've downloaded the XML::Parser module and am attempting to install it in my working directory (referenced via PERL5LIB env):
Expand|Select|Wrap|Line Numbers
  1. PERL5LIB=/Users/Ric/Library/Perl/
  2.  
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/Library/perl]ls
  2. XML-Parser-2.34/        XML-Parser-2.34.tar
  3.  
Per inclosed README, I performed the following:
1) Build the makefile:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/Library/perl/XML-Parser-2.34]ls
  2. Changes         MANIFEST        Parser/         README          t/
  3. Expat/          Makefile.PL     Parser.pm       samples/
  4.  
  5. [/Users/Ric/Library/perl/XML-Parser-2.34]perl MakeFile.PL
  6. Checking if your kit is complete...
  7. Looks good
  8. Writing Makefile for XML::Parser::Expat
  9. Writing Makefile for XML::Parser
  10.  
2) Perform the make:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/Library/perl/XML-Parser-2.34]make
  2. cp Parser/Encodings/x-sjis-cp932.enc blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
  3. cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
  4. cp Parser/Style/Tree.pm blib/lib/XML/Parser/Style/Tree.pm
  5. cp Parser/Encodings/iso-8859-9.enc blib/lib/XML/Parser/Encodings/iso-8859-9.enc
  6. ...
  7. Manifying blib/man3/XML::Parser::Style::Tree.3
  8. Manifying blib/man3/XML::Parser::Style::Stream.3
  9.  
3) make test:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/Library/perl/XML-Parser-2.34]make test
  2. make[1]: Entering directory `/Users/Ric/Library/Perl/XML-Parser-2.34/Expat'
  3. make[1]: Leaving directory `/Users/Ric/Library/Perl/XML-Parser-2.34/Expat'
  4. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
  5. t/astress.........ok                                                         
  6. t/cdata...........ok                                                         
  7. t/decl............ok                                                         
  8. t/defaulted.......ok                                                         
  9. t/encoding........"my" variable $p masks earlier declaration in same scope at t/encoding.t line 94.
  10. t/encoding........FAILED test 3                                              
  11.         Failed 1/6 tests, 83.33% okay
  12. t/external_ent....Couldn't load LWP based external entity handler
  13. Switching to file-based external entity handler
  14.  (To avoid this message, use NoLWP option to XML::Parser)
  15. t/external_ent....ok                                                         
  16. t/file............ok                                                         
  17. t/finish..........ok                                                         
  18. t/namespaces......ok                                                         
  19. t/parament........Couldn't load LWP based external entity handler
  20. Switching to file-based external entity handler
  21.  (To avoid this message, use NoLWP option to XML::Parser)
  22. t/parament........ok                                                         
  23. t/partial.........ok                                                         
  24. t/skip............ok                                                         
  25. t/stream..........ok                                                         
  26. t/styles..........ok                                                         
  27. Failed Test  Stat Wstat Total Fail  List of Failed
  28. -------------------------------------------------------------------------------
  29. t/encoding.t                6    1  3
  30. Failed 1/14 test scripts. 1/130 subtests failed.
  31. Files=14, Tests=130,  0 wallclock secs ( 0.46 cusr +  0.14 csys =  0.60 CPU)
  32. Failed 1/14 test programs. 1/130 subtests failed.
  33. make: *** [test_dynamic] Error 255
  34.  
  35. [/Users/Ric/Library/perl/XML-Parser-2.34]
  36.  

Question: What is the signifigance of this test and what is it saying in layman's terms?

4) Checking the Build Library:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/Library/perl/XML-Parser-2.34]ls -R blib/
  2. arch/   bin/    lib/    man1/   man3/   script/
  3.  
  4. blib//arch:
  5. auto/
  6.  
  7. blib//arch/auto:
  8. XML/
  9.  
  10. blib//arch/auto/XML:
  11. Parser/
  12.  
  13. blib//arch/auto/XML/Parser:
  14. Expat/
  15.  
  16. blib//arch/auto/XML/Parser/Expat:
  17. Expat.bs        Expat.bundle*
  18.  
  19. blib//bin:
  20.  
  21. blib//lib:
  22. XML/    auto/
  23.  
  24. blib//lib/XML:
  25. Parser/         Parser.pm
  26.  
  27. blib//lib/XML/Parser:
  28. Encodings/              Expat.pm                LWPExternEnt.pl         Style/
  29.  
  30. blib//lib/XML/Parser/Encodings:
  31. Japanese_Encodings.msg  iso-8859-2.enc          iso-8859-7.enc          windows-1252.enc        x-sjis-jdk117.enc
  32. README                  iso-8859-3.enc          iso-8859-8.enc          x-euc-jp-jisx0221.enc   x-sjis-jisx0221.enc
  33. big5.enc                iso-8859-4.enc          iso-8859-9.enc          x-euc-jp-unicode.enc    x-sjis-unicode.enc
  34. euc-kr.enc              iso-8859-5.enc          windows-1250.enc        x-sjis-cp932.enc
  35.  
  36. blib//lib/XML/Parser/Style:
  37. Debug.pm        Objects.pm      Stream.pm       Subs.pm         Tree.pm
  38.  
  39. blib//lib/auto:
  40. XML/
  41.  
  42. blib//lib/auto/XML:
  43. Parser/
  44.  
  45. blib//lib/auto/XML/Parser:
  46. Expat/
  47.  
  48. blib//lib/auto/XML/Parser/Expat:
  49.  
  50. blib//man1:
  51.  
  52. blib//man3:
  53. XML::Parser.3                   XML::Parser::Style::Objects.3   XML::Parser::Style::Tree.3
  54. XML::Parser::Expat.3            XML::Parser::Style::Stream.3
  55. XML::Parser::Style::Debug.3     XML::Parser::Style::Subs.3
  56.  
  57. blib//script:
  58.  
  59. [/Users/Ric/Library/perl/XML-Parser-2.34]
  60.  
The above looks 'okay' to me.

Question: Can I access this module from my perl script? What would be the correct syntax to do so?

Here the calling routine (ric.pl):
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use diagnostics; 
  3.  
  4. use XML::Parser;
  5.  
  6. print "Done.";
  7.  
Here's the result:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/workarea/perl]perl ric.pl
  2. Can't locate XML/Parser.pm in @INC (@INC contains: /Users/Ric/Library/Perl/ /opt/local/lib/perl5/5.9.5/darwin-2level /opt/local/lib/perl5/5.9.5 /opt/local/lib/perl5/site_perl/5.9.5/darwin-2level /opt/local/lib/perl5/site_perl/5.9.5 /opt/local/lib/perl5/vendor_perl/5.9.5/darwin-2level /opt/local/lib/perl5/vendor_perl/5.9.5 /opt/local/lib/perl5/vendor_perl .) at ric.pl line 3.
  3. BEGIN failed--compilation aborted at ric.pl line 3 (#1)
  4.     (F) You said to do (or require, or use) a file that couldn't be
  5.     found. Perl looks for the file in all the locations mentioned in @INC,
  6.     unless the file name included the full path to the file.  Perhaps you
  7.     need to set the PERL5LIB or PERL5OPT environment variable to say where
  8.     the extra library is, or maybe the script needs to add the library name
  9.     to @INC.  Or maybe you just misspelled the name of the file.  See
  10.     perlfunc/require and lib.
  11.  
  12. Uncaught exception from user code:
  13.         Can't locate XML/Parser.pm in @INC (@INC contains: /Users/Ric/Library/Perl/ /opt/local/lib/perl5/5.9.5/darwin-2level /opt/local/lib/perl5/5.9.5 /opt/local/lib/perl5/site_perl/5.9.5/darwin-2level /opt/local/lib/perl5/site_perl/5.9.5 /opt/local/lib/perl5/vendor_perl/5.9.5/darwin-2level /opt/local/lib/perl5/vendor_perl/5.9.5 /opt/local/lib/perl5/vendor_perl .) at ric.pl line 3.
  14. BEGIN failed--compilation aborted at ric.pl line 3.
  15.  at ric.pl line 3
  16.  
  17. [/Users/Ric/workarea/perl]
  18.  
I'm lost here.
What am I missing?

Regards,

Ric.

P.S. The following is some supplemental info:
Expand|Select|Wrap|Line Numbers
  1. [/Users/Ric/workarea/perl]perl -V
  2. Summary of my perl5 (revision 5 version 9 subversion 5) configuration:
  3.   Platform:
  4.     osname=darwin, osvers=8.10.1, archname=darwin-2level
  5.     uname='darwin ricmac.ci.north-las-vegas.nv.us 8.10.1 darwin kernel version 8.10.1: wed may 23 16:33:00 pdt 2007; root:xnu-792.22.5~1release_i386 i386 i386 '
  6.     config_args='-des -Dprefix=/opt/local -Dccflags=-I'/opt/local/include' -Dldflags=-L/opt/local/lib -Dvendorprefix=/opt/local -Dusedevel -Dcc=/usr/bin/gcc-4.0'
  7.     hint=recommended, useposix=true, d_sigaction=define
  8.     useithreads=undef, usemultiplicity=undef
  9.     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  10.     use64bitint=undef, use64bitall=undef, uselongdouble=undef
  11.     usemymalloc=n, bincompat5005=undef
  12.   Compiler:
  13.     cc='/usr/bin/gcc-4.0', ccflags ='-I/opt/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include',
  14.     optimize='-O3',
  15.     cppflags='-no-cpp-precomp -I/opt/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/local/include'
  16.     ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5367)', gccosandvers=''
  17.     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  18.     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  19.     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  20.     alignbytes=8, prototype=define
  21.   Linker and Libraries:
  22.     ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/opt/local/lib -L/usr/local/lib'
  23.     libpth=/usr/local/lib /opt/local/lib /usr/lib
  24.     libs=-ldbm -ldb -ldl -lm -lc
  25.     perllibs=-ldl -lm -lc
  26.     libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
  27.     gnulibc_version=''
  28.   Dynamic Linking:
  29.     dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  30.     cccdlflags=' ', lddlflags='-L/opt/local/lib -bundle -undefined dynamic_lookup -L/usr/local/lib'
  31.  
  32.  
  33. Characteristics of this binary (from libperl): 
  34.   Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
  35.                         USE_LARGE_FILES USE_PERLIO
  36.   Built under darwin
  37.   Compiled at Oct 12 2007 11:02:55
  38.   %ENV:
  39.     PERL5LIB="/Users/Ric/Library/Perl/"
  40.   @INC:
  41.     /Users/Ric/Library/Perl/
  42.     /opt/local/lib/perl5/5.9.5/darwin-2level
  43.     /opt/local/lib/perl5/5.9.5
  44.     /opt/local/lib/perl5/site_perl/5.9.5/darwin-2level
  45.     /opt/local/lib/perl5/site_perl/5.9.5
  46.     /opt/local/lib/perl5/vendor_perl/5.9.5/darwin-2level
  47.     /opt/local/lib/perl5/vendor_perl/5.9.5
  48.     /opt/local/lib/perl5/vendor_perl
  49.     .
  50.  
  51. [/Users/Ric/workarea/perl]
  52.  
Oct 17 '07 #1
0 2205

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Paulo Pinto | last post by:
Hi, does anyone know of a Python package that is able to load XML like the XML::Simple Perl package does? For those that don't know it, this package maps the XML file to a dictionary.
0
by: flamencoman | last post by:
Hi, Has any one used the XML::Parser module with the Subs style? The Perl documentation states: "Each time an element starts, a sub by that name in the package specified by the Pkg option...
6
by: Don HO | last post by:
Hi, I'm developing a project in C++ under MS Windows (without MFC). I want to use an xml file as the configuration file of the program. The problem is : after downloading xerces, I realized...
2
by: Magnus Heino | last post by:
Hi. Are there any patterns or other design techniques that could be used when implementing a xml parser that needs to be able to handle different versions of a schema? Let's say that I write...
3
by: UndoMiel | last post by:
Hi, I am looking for an XML parser in C that is able to validate the XML documents against XSD Schema... Can anyone give me ideas? Thanks!
16
by: Mike | last post by:
Does anyone know of a minimal/mini/tiny/small xml parser in c? I'm looking for something small that accepts a stream or string, builds a c structure, and then returns an opaque pointer to that...
5
by: vc | last post by:
Hi, I'm looking for an XML parser that wouldn't stop if it finds a minor error in an XML file. I need to parse an HTML file and there are a lot of HTML pages that, for instance, don't enclose...
8
by: Elmar Brandt | last post by:
Hello, we are looking for a fast XML parser. The XML-files are very big (>2GB) and we want to convert them into other formats via XSLT. Has anyone an idea? With best regards Elmar Brandt
1
by: onewaylife | last post by:
Hi all I am novice in XML. I have just started to creating PHP parser for XML files. I am using SAX. the file is : - <html> <head> <basefont face="Arial"> </head> <body> <?php
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.