Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: XML::Simple needs to go!

by mr_mischief (Monsignor)
on Jan 07, 2016 at 17:22 UTC ( #1152217=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Simple needs to go!
in thread XML::Simple needs to go!

Nested hashes and arrays could be forced into all three, albeit perhaps at the expense of some awkwardness. After all, it's all structured data. Below is just a quick example and I'm not writing this node to promote writing code to support this data structure. It's certainly not impossible, though, to denote these things.:

my %data = ( 'attributes' => { '_name' => 'mydata', 'height' => 50, 'width' => '80%', }, 'children' => [ { 'attributes' => { '_name' => 'bob', ...} ...}, { 'attributes' => { '_name' => 'tom', ...} ...}, ], 'content' => 'yadda yadda ...', );

Whether that's something you'd want to process later is another issue. Some people like to put a lot of predetermined information about their data into their code. Others like to keep the data as self-describing as possible and keep the code very general to work with that. There are strengths and weaknesses to either approach.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1152217]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2018-06-20 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (117 votes). Check out past polls.

    Notices?