For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2004 > XMLin() not finding XML::SAX or XML::Parser modules Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XMLin() not finding XML::SAX or XML::Parser modules Problem
Ajey Kulkarni

2004-09-23, 3:56 pm

Hi,
XMLin() requires either XML::SAX or XML::Parser at line number blah blah.
I actually copied these two perl modules in the right place but still then
my script is not able to find these.(in @INC).

I'm trying to call this XMLin() function from another perl module.

Am i missing anything here? Any pointers?


Thanks a ton
-Ajey

Chris Devers

2004-09-23, 8:57 pm

On Thu, 23 Sep 2004, Ajey Kulkarni wrote:

> XMLin() requires either XML::SAX or XML::Parser at line number blah blah.
> I actually copied these two perl modules in the right place but still then
> my script is not able to find these.(in @INC).


What is XMLin() ?

Ahh, I see, it's a method provided by XML::Simple:

<http://www.perldoc.com/perl5.6.1/li...mple.html#XMLin()>

Ok, so, how did you get XML::Simple installed without one or the other
of the two required modules? Did you manually copy, or `force install`?

It sounds like all three modules may be out of whack.

The easiest approach is to install them all with the CPAN shell.

$ sudo perl -MCPAN -e shell

If you haven't run this before, you will spend the next five minutes or
so answering questions about your environment. In most cases, you can
just hit enter to accept the defaults that are suggested to you.

Once setup is complete, the shell launches with a

cpan>

prompt. You need to install one of the prerequisites, then XML::Simple :

cpan> install XML::Parser
cpan> install XML::Simple

Once these complete, programs using XML::Simple methods such as XMLin()
should begin to work normally.



--
Chris Devers
Chris Devers

2004-09-23, 8:57 pm

Please send all replies to the list, not me directly. Thanks.

On Thu, 23 Sep 2004, Ajey Kulkarni wrote:

> Thanks a bunch Chris. I FORCED the pms to be copied.
> I'll try to install this and get it running.


It usually isn't a good idea to force an install unless you understand
what the error you're getting means and are confident that in a given
case it can be safely ignored.

In this case, the README file is clear that you need to have one of the
two modules you noted in order for things to work. If you skip that
step, then, well, things won't work.

On the bright side, you probably don't have to reinstall XML::Simple;
once the support module[s] is/are in place, XMLin(...) should work. Or
at least that's what it seems like will happen...


--
Chris Devers
Ajey Kulkarni

2004-09-24, 3:59 pm

I installed the expat libs,but the cpan shell is now asking
for EXPATLIBPATH and EXPATINCPATH.

It says

perl Makefile.PL <path_to_libraries>

Now,how do i specify these paths for XML::Module installation??

Where is this Makefile.PL file?

Regards again
-Ajey


On Thu, 23 Sep 2004, Chris Devers wrote:

> Please send all replies to the list, not me directly. Thanks.
>
> On Thu, 23 Sep 2004, Ajey Kulkarni wrote:
>
>
> It usually isn't a good idea to force an install unless you understand
> what the error you're getting means and are confident that in a given
> case it can be safely ignored.
>
> In this case, the README file is clear that you need to have one of the
> two modules you noted in order for things to work. If you skip that
> step, then, well, things won't work.
>
> On the bright side, you probably don't have to reinstall XML::Simple;
> once the support module[s] is/are in place, XMLin(...) should work. Or
> at least that's what it seems like will happen...
>
>
> --
> Chris Devers
>
>


Chris Devers

2004-09-24, 3:59 pm

On Fri, 24 Sep 2004, Ajey Kulkarni wrote:

> I installed the expat libs,but the cpan shell is now asking
> for EXPATLIBPATH and EXPATINCPATH.


Oh. That. Yeah, that's a pain.

The first thing is to get Expat installed, which I forgot about before.
Instructions for this will vary depending what OS you're running on. The
docs for whichever of XML::SAX or XML::Parser you're going with may have
more notes to go by here.

Once Expat is installed, you need to set those variables for Perl to use
while building. The two ways I can think of doing this are:

* set them before launching the CPAN shell with one of these methods:

$ sudo perl -MCPAN -e shell EXPATLIBPATH=... EXPATINCPATH=...

or

$ export EXPATLIBPATH=...
$ export EXPATINCPATH=...
$ sudo perl -MCPAN -e shell

(Note that if you use csh/tcsh, it's `setenv FOO "bar"` instead.)

* or, run the CPAN shel to download, then open a subshell to build:

$ sudo perl -MCPAN -e shell
cpan> get XML::Parser
cpan> look XML::Parser
# perl Makefile.PL EXPATLIBPATH=... EXPATINCPATH=...
# make && make test && make install

I can be more specific if I know what operating system you're running
and which Unix shell (bash, tcsh, etc) you're using, but in general the
approach will be along these lines.



--
Chris Devers
Wiggins d Anconia

2004-09-24, 3:59 pm

> On Fri, 24 Sep 2004, Ajey Kulkarni wrote:
>
>
> Oh. That. Yeah, that's a pain.
>
> The first thing is to get Expat installed, which I forgot about before.
> Instructions for this will vary depending what OS you're running on. The
> docs for whichever of XML::SAX or XML::Parser you're going with may have
> more notes to go by here.
>
> Once Expat is installed, you need to set those variables for Perl to use
> while building. The two ways I can think of doing this are:
>
> * set them before launching the CPAN shell with one of these methods:
>
> $ sudo perl -MCPAN -e shell EXPATLIBPATH=... EXPATINCPATH=...
>
> or
>
> $ export EXPATLIBPATH=...
> $ export EXPATINCPATH=...
> $ sudo perl -MCPAN -e shell
>
> (Note that if you use csh/tcsh, it's `setenv FOO "bar"` instead.)
>
> * or, run the CPAN shel to download, then open a subshell to build:
>
> $ sudo perl -MCPAN -e shell
> cpan> get XML::Parser
> cpan> look XML::Parser
> # perl Makefile.PL EXPATLIBPATH=... EXPATINCPATH=...
> # make && make test && make install
>


In the case of using CPAN you can temporarily (or permanantly) set these
options using:

> o conf makepl_arg "EXPATINCPATH=... EXPATLIBPATH=..."


If you have other arguments to Makefile.PL you don't want to clobber
them so they will have to be set in the above too. To see what is
already configured just issue,

> o conf


By itself. You can reset makepl_arg back to empty once the module is
installed, though I would be surprised if it mattered. If you want to
keep them as permanant settings, issue,

> o conf commit


Before closing your session.

> I can be more specific if I know what operating system you're running
> and which Unix shell (bash, tcsh, etc) you're using, but in general the
> approach will be along these lines.
>
>
>
> --
> Chris Devers
>


http://danconia.org

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com