Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1152217]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2022-12-06 01:25 GMT
Find Nodes?
    Voting Booth?

    No recent polls found