Can't find module

M

Mark

I wrote a Perl program which works fine on my Linux box, but not another
one. It uses XML::Simple. When run on this other box, I get this error:

XMLin() requires either XML::SAX or XML::parser at /tmp/hg.pl line 342

So this sounds like a simple module-location issue that is easy to
solve, right? Not to me, anyway. The strange part is that when I print
the contents of @INC, it shows me the expected PATH list and I have
verified that XML/Parser.pm does indeed exist in at least one place in
that PATH list. I don't understand why Perl can't find Parser.pm on
this other box when it is clearly in the PATH. Could it be that
XML/Simple.pm modifies @INC? If so, I couldn't find where... I tried
moving XML/Parser.pm to other places in the PATH, including the same
place that XML/Simple.pm exists, but still get the same error.

Here is the contents of @INC that I print out:

/usr/local/perl5.8.5/lib/site_perl/5.8.5/i686-linux
/usr/local/perl5.8.5/lib/site_perl/5.8.5
/usr/lib/perl5/vender_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/local/perl5.8.5/lib/site_perl/5.8.5/ChartDirector
/usr/local/perl/lib/site_perl/5.8.5/i686-linux
/usr/local/perl/lib/site_perl/5.8.5
/usr/local/perl/lib/site_perl
/usr/local/perl/lib/5.8.5/i686-linux
/usr/local/perl/lib/5.8.5
/usr/local/perl/lib
/usr/local/perl5.8.5/lib/5.8.5/i686-linux
/usr/local/perl5.8.5/lib/5.8.5
/usr/local/perl5.8.5/lib/site_perl

Some places were added specifically to try to solve this problem, so
there is more than there really needs to be for now... Parser.pm exists
here:
/usr/lib/perl5/vender_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm

Any ideas?

Mark
 
S

Sisyphus

Mark said:
I wrote a Perl program which works fine on my Linux box, but not another
one. It uses XML::Simple. When run on this other box, I get this error:

XMLin() requires either XML::SAX or XML::parser at /tmp/hg.pl line 342

So this sounds like a simple module-location issue that is easy to
solve, right? Not to me, anyway. The strange part is that when I print
the contents of @INC, it shows me the expected PATH list and I have
verified that XML/Parser.pm does indeed exist in at least one place in
that PATH list. I don't understand why Perl can't find Parser.pm on
this other box when it is clearly in the PATH. Could it be that
XML/Simple.pm modifies @INC? If so, I couldn't find where... I tried
moving XML/Parser.pm to other places in the PATH, including the same
place that XML/Simple.pm exists, but still get the same error.

Here is the contents of @INC that I print out:

/usr/local/perl5.8.5/lib/site_perl/5.8.5/i686-linux
/usr/local/perl5.8.5/lib/site_perl/5.8.5
/usr/lib/perl5/vender_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/local/perl5.8.5/lib/site_perl/5.8.5/ChartDirector
/usr/local/perl/lib/site_perl/5.8.5/i686-linux
/usr/local/perl/lib/site_perl/5.8.5
/usr/local/perl/lib/site_perl
/usr/local/perl/lib/5.8.5/i686-linux
/usr/local/perl/lib/5.8.5
/usr/local/perl/lib
/usr/local/perl5.8.5/lib/5.8.5/i686-linux
/usr/local/perl5.8.5/lib/5.8.5
/usr/local/perl5.8.5/lib/site_perl

Some places were added specifically to try to solve this problem, so
there is more than there really needs to be for now... Parser.pm exists
here:
/usr/lib/perl5/vender_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm

Any ideas?

A permissions issue, perhaps ? .... either with Parser.pm itself, or the
directory that houses it ?
Bear in mind that there's more to XML::parser than just the .pm file.
Expat.so also needs to be locatable.

What happens when you run:

perl -MXML::parser -le 'print OK'

Cheers,
Rob
 
B

Bart Lateur

Mark said:
I wrote a Perl program which works fine on my Linux box, but not another
one. It uses XML::Simple. When run on this other box, I get this error:

XMLin() requires either XML::SAX or XML::parser at /tmp/hg.pl line 342

So this sounds like a simple module-location issue that is easy to
solve, right? Not to me, anyway.
Parser.pm exists
here:
/usr/lib/perl5/vender_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm

Any ideas?

Yeah, try a simple

perl -MXML::parser -ce 1

or in your script (in front of "use XML::SImple"):

use XML::parser;

If that doesn't barf, then you must have a configuration issue with
XML::Simple.
 
J

Joe Smith

A. Sinan Unur said:
Why the discrepancy?

And what discrepancy is that?
My system also has a mixture of old and new.

fedora% perl -le 'print join "\n",@INC'
/usr/lib/perl5/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl/5.8.2
/usr/lib/perl5/site_perl/5.8.1
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top