Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Parsing complex data

by sh1tn (Priest)
on Jul 15, 2005 at 15:56 UTC ( [id://475266]=note: print w/replies, xml ) Need Help??


in reply to Parsing complex data

my @data = [ mykey1 => {firstkey => 'firstvalue', secondkey => 'secondval' }, mykey2 => {ninza => 'turtle', 'Hurricane' => 'Dennis'}, mykey3 => [ [one,two, three] ], mykey4 => [ [4, 5, three], [6, 7, four], [8, 9, five] ], ]; for( @{$data[0]} ){ ref or print "$_ => " and next; ref eq 'SCALAR' and print $$_ and next; ref eq 'HASH' and print join( ',', values %$_ ), $/; ref eq 'ARRAY' and do { for( @{$_} ){ print join( ',', split( '\s', "@$_ " )) } print $/ }; }


Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 07:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found