Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: XML tree to HASH

by eric256 (Parson)
on Aug 15, 2003 at 15:06 UTC ( #284173=note: print w/replies, xml ) Need Help??


in reply to XML tree to HASH

You could store the info $hash{$element}{$parentID} = 1;

Then if ($hash{$element}{$parentID}) would tell you if it was a parent or not. I'm not sure if its any better than sticking them all in a string and regexing it. If you do regex make sure to delimit each id so that checking for 2 doesn't match the 2 in 20.

___________
Eric Hodges

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2023-02-06 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (33 votes). Check out past polls.

    Notices?