By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,456 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,456 IT Pros & Developers. It's quick & easy.

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

P: 10
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
Share this question for a faster answer!
Share on Google+

Post your reply

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