473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Parsing XML File using Perl

Hi,

I am trying to set up environment for XML parsing using perl. I downloaded XML::Simple and installed it too. When i try to run my program, it says, you need to install parser. When i try to install XML::Parser, it says i need to install expact parser. But when i do not how to install and set up that. Can anybody help me know the shortest and quickest way to run my perl script which is ready to parse a xml file. Also i have installed XML::SAX by mistake which is half done,can anybody tell me how to uninstall that?

Regards,
Amit
Jul 3 '07 #1
3 3075
numberwhun
3,509 Expert Mod 2GB
First, if you go to the CPAN pages for the modules, you will generally find that near the bottom of the page the authors typically put documentation of the pre-requisites for the module. This may help at times in resolving dependencies.

Did you try installing "XML::Parser::Expat"?

One other thing. A tip that has saved me many times from dependencies. When you first run the command "perl -MCPAN -e shell", you will be prompted with a whole series of questions. One particular question asks you how you want to handle dependencies. I always answer this with "follow" instead of the default "ask". This way, when I install a module, Perl goes ahead and automatically installs any and all dependencies quietly, without asking about it first.

Sorry I couldn't be more help with the Expat piece. Maybe one of the others will know the answer.

Regards,

Jeff
Jul 3 '07 #2
Thanks Jeff,

Extending this topic again...

I want to install XML::Parser for perl. When i tried installing that package, it gave me error saying XML::expact need to be installed. I downloaded XML::Expact and when i tried to install it, it asked me to install gcc.

Can anybody give me the link for downloading gcc from internet. i downloaded the gcc package from sunfreeware.com (package name gcc_small-3.3.2-sol9-intel-local.gz) by following the following steps:-

To decompress the downloaded package file:

# cd /opt/temp
# gunzip gcc*
# cd /opt/temp
# pkgadd -d gcc*

everything looks to be fine, but when i try to run expact, i get the following error:--
checking build system type... sparc-sun-solaris2.9
checking host system type... sparc-sun-solaris2.9
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables

Does it mean that gcc has not been installed properly? If my gcc has not been installed properly, please let me know the proper way to install it properly.

Needless to say, thanks in advance to all of you for your help.

Cheers,
Amit
Jul 4 '07 #3
numberwhun
3,509 Expert Mod 2GB
First thing I want to say is that it looks like you are trying to install modules that way that Miller had described in the other article that you had cross posted to. I agree with Miller that you should really use the package management system to install modules and use actually building the modules locally as a last resort if you don't have root access to the system. If you do NOT have root access, then installing gcc with its default locations won't work as the executables get written to a directory or directories that only root has permissions to write to. You would again be out of luck. If you are in that type of situation where you don't have root access, you would have to make modifications to the installation package of gcc to have it install into a directory that you DO have access to write to.

That said, if you do have root access, then you should really consider using something like the following convention to install your package(s):

perl -MCPAN -e 'install <package_name>'

If you haven't run this command before, you will have to probably not only have to go through the CPAN configuration, it will be suggested after you set it you to install Bundle::CPAN before going further. This will bring your base module system up to date or install it.

Also, when going through the CPAN configuration, I always suggest to people that when asked about how to handle dependencies, I recomend the option of "follow" so it automatically installs package dependencies for you.

That said, hopefully this helps or gets you a little further.

Regards,

Jeff
Jul 4 '07 #4

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

Similar topics

1
by: Scott | last post by:
I am new to perl, and have not found any good examples of parsing to help me out. I have a text file that I am reading into an array that has to be parsed out and put into another file. I have not...
0
by: Antwerp | last post by:
Hi, I'm trying to create a perl script that will log into a website (the login form uses POST), navigate to several pages, and append the (html) content parsed from those pages to a seperate log...
8
by: Jean-Marie Vaneskahian | last post by:
Reading - Parsing Records From An LDAP LDIF File In .Net? I am in need of a .Net class that will allow for the parsing of a LDAP LDIF file. An LDIF file is the standard format for representing...
1
by: Robert Neville | last post by:
Basically, I want to create a table in html, xml, or xslt; with any number of regular expressions; a script (Perl or Python) which reads each table row (regex and replacement); and performs the...
4
by: R Wood | last post by:
Greetings - A recent Perl experiment hasn't turned out so well, which has piqued my interest in Python. The project is this: take a Vcard file exported from Apple's Addressbook and use a...
5
by: moddster | last post by:
Hi Guys. I am a newbie to perl and need some help with a problem. PROBLEM: I have to parse an HTML file and get rid of all the HTML tags and count the number of sumbissions a person has through...
2
by: Gary42103 | last post by:
Hi I need Perl Script to do Data Parsing using existing data files. I have my existing data files in the following directory: Directory Name: workfs/ams Data File Names: 20070504.dat,...
4
by: DjLethal | last post by:
Hey Guys.I am a newbie on Perl.And I have a question about file parsing by perl. I have a log file which contains reports about a communication machine.I need to take some of the reports from the...
6
by: Damien87 | last post by:
Hi, I have a .data file which is essentially just a text file with a bunch of numbers. It's in the format "xx yy zzz abc ccf fffd sss xxx xx sss qq" Basically it is a random amount of numbers...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.