Parse tree like data like XML by Perl?

D

Davy

Hi all,

I used to embed data in program use something like "case" or
"if..else". But my friend advice me to separate program and data. So I
want to use a tree-like data file like XML.

The question is:
1. Is there any better or easier standardized tree-like data structure
than XML?
2. If XML is better, I am new to it, what shall I learn to use it by
Perl?

Please recommend some tool or reading material about the topic, thanks!

Best regards,
Davy
 
M

Michael Goerz

Davy said:
Hi all,

I used to embed data in program use something like "case" or
"if..else". But my friend advice me to separate program and data. So I
want to use a tree-like data file like XML. Might be a good idea.

The question is:
1. Is there any better or easier standardized tree-like data structure
than XML? Probably not.
2. If XML is better, I am new to it, what shall I learn to use it by
Perl?
XML is pretty good. The best way to learn it is to do some reading and
then jump in the water by coding a little bit. Some good resources to
get you started:

The absolute prime resource:
http://perl-xml.sourceforge.net/faq/

For a complete beginner maybe this is easiest:
http://search.cpan.org/~grantm/XML-Simple-2.15/lib/XML/Simple.pm

The full deal is something like this:
http://search.cpan.org/~kmacleod/libxml-perl-0.08/
Lot's of other modules on CPAN, too!

Good Tutorial:
http://www.xml.com/pub/a/2001/02/14/perlsax.html
Check out other stuff at xml.com, too.

Just do a little bit of reading, and then start coding, which is the
best way to understand XML. There's somewhat of a learning curve,
depending on how much you know alrady about perl and/or XML, but it
should be worth it.

Michael
 
D

Davy

Michael said:
XML is pretty good. The best way to learn it is to do some reading and
then jump in the water by coding a little bit. Some good resources to
get you started:

The absolute prime resource:
http://perl-xml.sourceforge.net/faq/

For a complete beginner maybe this is easiest:
http://search.cpan.org/~grantm/XML-Simple-2.15/lib/XML/Simple.pm

The full deal is something like this:
http://search.cpan.org/~kmacleod/libxml-perl-0.08/
Lot's of other modules on CPAN, too!

Good Tutorial:
http://www.xml.com/pub/a/2001/02/14/perlsax.html
Check out other stuff at xml.com, too.

Just do a little bit of reading, and then start coding, which is the
best way to understand XML. There's somewhat of a learning curve,
depending on how much you know alrady about perl and/or XML, but it
should be worth it.
[snip]
Hi Michael,

Thanks a lot! I have write a lot of Perl code for hardware simulation
environment, but know a little about XML(I just know <>).

I will try to understand the prime you mention.

Best regards,
Davy
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top