CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Please help in accessing complex data structure

 



pinky
Novice

Nov 20, 2011, 12:19 AM

Post #1 of 4 (3289 views)
Please help in accessing complex data structure Can't Post

Hi,



I have a data structure dumped using XML::Simple , a xml file.



$VAR1 = {

'a:b' => 'link',

'b:d' => {

'abd:mem' => {

'shbf:iueh' => {

'dhgfk:uehyksadf' => {

'suhdf:jsdfh' => [

{

'jkfsdh:kskdufh' => 'dsljfhlfds',

'ljdf:soeuhlkjsdf' => {

abds:lsdkfkj => sdjdfh:usdfhk,

ksdjhf:lailhdfldf => ksdhfk:ajjhdksj,

},

'duifhkidf:lsldjfhkjsdh' => '354',

},

{

'dslkhfjlksdf:sdfhkjsfd' => ljsdhfkj,

'dskfjhjk:eiufhyiku' => kuhsdfkj

},

}

},

}


wickedxter
User

Nov 20, 2011, 5:52 AM

Post #2 of 4 (3284 views)
Re: [pinky] Please help in accessing complex data structure [In reply to] Can't Post


Code
$VAR1 = {  
'a:b' => 'link',
'b:d' => {
'abd:mem' => {
'shbf:iueh' => {
'dhgfk:uehyksadf' => {
'suhdf:jsdfh' => [ {
'jkfsdh:kskdufh' => 'dsljfhlfds',
'ljdf:soeuhlkjsdf' =>
{
abds:lsdkfkj => sdjdfh:usdfhk,
ksdjhf:lailhdfldf => ksdhfk:ajjhdksj,
},

'duifhkidf:lsldjfhkjsdh' => '354',

{
'dslkhfjlksdf:sdfhkjsfd' => ljsdhfkj,
'dskfjhjk:eiufhyiku' => kuhsdfkj
},]
}

},

}


This is a deep nested data structure...
'suhdf:jsdfh' is Hash of Array Hash

Code
$VAR1{b:d}{abd:mem}{shbf:iueh}{dhgfk:uehyksadf}{suhdf:jsdfh}[0]

this is the main access then everything inside the array hash you can loop threw


pinky
Novice

Nov 22, 2011, 12:03 AM

Post #3 of 4 (3162 views)
Re: [wickedxter] Please help in accessing complex data structure [In reply to] Can't Post

Thanks a lot.. i got the basic idea.



One more question.. Is there any way i can compare two xml files?



Thanks

Pinky.


rovf
Veteran

Nov 23, 2011, 6:32 AM

Post #4 of 4 (3143 views)
Re: [pinky] Please help in accessing complex data structure [In reply to] Can't Post

http://lmgtfy.com/?q=Perl+XML+compare

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives