Solved

XML::Simple not finding parse method

Posted on 2006-11-21
14
951 Views
Last Modified: 2011-10-03
Just upgraded to Perl 5.8.8. XML::SImple used to parse my file of XML data with no problem. Now get this error,

use XML::Simple;
my $xml_parser = new XML::Simple;
 $out = $xml_parser->XMLin($xml_file_name);

No _parse_* routine defined on this driver (If it is a filter, remember to set the Parent property. If you call the parse() method, make sure to set a Source. You may want to call parse_uri, parse_string or parse_file instead.) [XML::SAX::Expat=HASH(0x826ea44)] at /usr/local/lib/perl5/site_perl/5.8.8/XML/SAX/Base.pm line 2616.

The default parser, XML::SAX::Expat is installed and tested ok.
0
Comment
Question by:Kim Ryan
14 Comments
 
LVL 8

Expert Comment

by:Perl_Diver
ID: 17994240
update your XML::Simple module and see if that helps. Also read the documentation of the newest version of XML::Simple
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 17994498
Am running latest version of XML::Simple. Read through doco.
0
 
LVL 17

Expert Comment

by:mjcoyne
ID: 17995614
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 18001122
Thanks mjcoyne, have read the comment. I am not calling parse_file directly, this is done internally bey XML::Simple.. My problem is that XML::Simple used to work fine, but now wont parse anything since I upgraded perl. Have sifted thru module source code, but completely stumped on this one.

(using Linux RH9)
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 18005219
OK, found the error. The shared object Expat.so did not have the right permsissions, along with it's paretn diredtories.

This has caused me other problems. I upgraded my CPAN module and installed several modules with it but the directory permissions are wrong, no read access for 'other'. I used a umask of 002 but  still a problem.

Am happy to raise this as a new question with 500 points if anyone has an idea of what is causing the problem.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 51

Expert Comment

by:ahoffmann
ID: 18008483
> .. did not have the right permsissions, ..
which permissions does it have? what are the permissions of the directory?
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 18015413
it was rwxr----- I think
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 18034853
and is your user, which started the perl script, the same as the owner of the lib (as your permissions request)?
otherwise you need to chmod 444 Expat.so
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 18451137
I found the problem myself, was just a local permision problem. Can I get a points refund?
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 18451475
> .. was just a local permision problem.
that's what I said.
0
 
LVL 19

Author Comment

by:Kim Ryan
ID: 18595028
It was a local permision problem, as I found for myself. Not the type of problem someone could have picked up without access to my system. Thnaks for all the advice, but I think this is one I solved myself. Would prefer a points refund.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now