Home > Archive > PERL Beginners > October 2006 > Parse tree like data like XML by Perl?
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 |
Parse tree like data like XML by Perl?
|
|
|
| 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
| |
| Michael Goerz 2006-10-08, 9:57 pm |
| Davy wrote:
> 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-...b/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
| |
|
|
Michael Goerz wrote:
> Davy wrote:
> Might be a good idea.
> Probably not.
> 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-...b/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
> Michael
|
|
|
|
|