Help in installing XML::PARSER

V

vincente13

Hi all,

I need this module XML::pARSER. So i put it into the unix machine

I execute the command perl Makefile.PL

Output

perl Makefile.PL
Note (probably harmless): No library found for -lexpat

Expat must be installed prior to building XML::parser and I can't find
it in the standard library directories. You can download expat from:

http://sourceforge.net/projects/expat/


So i've downloaded expat

and now im execute the command sh configure

Output

configure: error: no acceptable C compiler found in $PATH

Its getting messy and more messy. How do i solve this problem?
Installing a module in Perl requires some many additional steps?
 
A

A. Sinan Unur

(e-mail address removed) wrote in @j73g2000cwa.googlegroups.com:
perl Makefile.PL
Note (probably harmless): No library found for -lexpat
....

So i've downloaded expat

and now im execute the command sh configure

Output

configure: error: no acceptable C compiler found in $PATH

Its getting messy and more messy. How do i solve this problem?
Installing a module in Perl requires some many additional steps?

You might be able to install a binary of expat depending on your
operating system, but any *nix system without a C compiler is going to
be severely limited.

How you should proceed depends on your OS. If it is one of the free OSs,
say Linux or *BSD, you should install gcc, make, binutils etc to have a
complete development environment.

This has more to do with you learning to use the OS of your choice than
with Perl. For OS specific questions, you should try a group that deals
with the particular OS.

Sinan

--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
V

vincente13

Is there an option without installing expat?

I'm task to write some Perl scripts to be hosted on a production
server, hence im trying to minimize the things to install so that the
scripts can just be brought over to another server.

Appreciate any suggestions
 
A

A. Sinan Unur

(e-mail address removed) wrote in @i40g2000cwc.googlegroups.com:

[ Please read http://cfaj.freeshell.org/google/ ]

[ Have you read the posting guidelines for this group yet? ]

Is there an option without installing expat?

I am assuming you are talking about XML::parser here. Have you actually
looked at the documentation for that module?

http://search.cpan.org/~msergeant/XML-Parser-2.34/Parser.pm

DESCRIPTION ^

This module provides ways to parse XML documents. It is built on top of
XML::parser::Expat, which is a lower level interface to James Clark's
expat library.

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
V

vincente13

Sorry, pardon me for my poor understanding.

This module provides ways to parse XML documents. It is built on top of
XML::parser::Expat, which is a lower level interface to James Clark's
expat library.

Does this means i can do without the expat library?
 
B

Ben Morrow

[please read and follow the posting guidelines]

Quoth (e-mail address removed):
Sorry, pardon me for my poor understanding.

This module provides ways to parse XML documents. It is built on top of
XML::parser::Expat, which is a lower level interface to James Clark's
expat library.

Does this means i can do without the expat library?

Not if you want to use XML::parser. There are other ways to parse XML,
though; look at the XML::SAX::purePerl module. It is slow, though. The
XML::SAX modules are probably easier to use than XML::parser anyway.

Ben
 
V

vincente13

After further reading
i understand that XML:pARSER requires the expat library to be
installed.
 
B

Bart Lateur

This module provides ways to parse XML documents. It is built on top of
XML::parser::Expat, which is a lower level interface to James Clark's
expat library.

Does this means i can do without the expat library?

Don't you see the paradox in what you just said above? No, you can't
have XML::parser::Expat without the expat library.

What you can do, is go look for a Pure Perl mechanism. Some modules are
rewritten in Perl, so no C compiler is needed to install them. There
might be such a module on CPAN, check for the addition of "PP" or
"PurePerl" in their names.

I know of one such module for XML, and that is the Pure Perl driver that
comes with XML::SAX. It's not XML::parser, it's more modern, so might
give that one a good look.

Of course, it's going to be slower than a solution in XS.
 
V

vincente13

Actually the problem lies down to using XPATH

my main intention was in using XPATH in querying the XML.
so i got XML::XPATH. XML::XPATH depends on XML::pARSER and this depends
on the expat library.

so probably is there any XPATH modules that is pure perl?
 
V

vincente13

sorry..

rather new to perl and unix machines..therefore been working on this
for the whole day..and started to realize what is missing and what
should be done..

so any alternatives to XML:XPath ? been searching the net, seems like i
can't find any..
 
D

Dr.Ruud

(e-mail address removed) schreef:
sorry..

rather new to perl and unix machines..therefore been working on this
for the whole day..and started to realize what is missing and what
should be done..
so any alternatives to XML:XPath ? been searching the net, seems like
i can't find any..

What have you done with the suggestions to start using XML::SAX?


#!/usr/bin/perl
# vincente13.pl

use strict ;
use warnings ;

do {local $/; $_ = <DATA> } ;

# Replace soft newlines by space.
s/(?<!\n)\n(?!\n)/ /g ;

# Remove spaces before hard newlines.
s/ +$/\n/mg ;

# Shrink dot sequences before hard newlines.
s/(\.)\.+$/$1/mg ;

# Remove spaces before [?!].
s/ +([?!])/$1/g ;

# Uppercase the first letter of a paragraph.
s/(?:\A|(?<=\n\n))([a-z])/\u$1/g ;

# Shrink dot sequences before a word,
# and insert a space,
# and uppercase the first letter of that word.
s/(\.)\.+([a-z])/$1 \u$2/g ;

# Change word "i" to "I".
s/\b(i)\b/\u$1/g ;

# Change ". And " to " ... "
s/\.( And )/\L$1/g ;

# Change ". Therefore " to ", ... "
s/\.( Therefore )/,\L$1/g ;

# Change phrase "been" to "I have been"
s/(?<!(?:have:has) )(been)\b/I have $1/g ;

# Change phrase "Rather" to "I am rather"
s/\b(Rather)/I am \l$1/g ;

# Change phrase "so any" to "so are there any"
s/\b([Ss]o) (any)\b/$1 are there $2/g ;

# Change phrase ", seems like I can't" to "and didn't"
s/, seems like I ca(n't)/ and did$1/g ;

print;

__DATA__
sorry..

rather new to perl and unix machines..therefore been working on this
for the whole day..and started to realize what is missing and what
should be done..

so any alternatives to XML:XPath ? been searching the net, seems like i
can't find any..
 
M

Mumia W.

sorry..

rather new to perl and unix machines..therefore been working on this
for the whole day..and started to realize what is missing and what
should be done..

so any alternatives to XML:XPath ? been searching the net, seems like i
can't find any..

If the CPAN shell is installed on your system, start it like so:

perl -MCPAN -e shell;

You might be able to read the CPAN man-page this way:

man CPAN

Configure the CPAN shell, and use it to install the modules you want. If
anything needs to be compiled with a C compiler, the CPAN shell will
compile it automatically if it can.
 
D

David Squire

Mumia said:
If the CPAN shell is installed on your system, start it like so:

perl -MCPAN -e shell;

.... and for the most seamless use, do

sudo perl -MCPAN -e shell

so that you can install modules as root and have them available
system-wide (assuming that you have sudo privileges).

DS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top