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

Re: Datastructure access

by toolic (Bishop)
on Oct 27, 2014 at 13:54 UTC ( #1105155=note: print w/replies, xml ) Need Help??


in reply to Datastructure access

One way to dereference the array:
use warnings; use strict; my %data = ( 'QUEUETIME' => '0.046', 'PROPERTY' => { 'DOMAIN' => [ 'a.com', 'b.com', 'c.com' ], 'LIMIT' => [ '1000' ], } ); my @domains = @{ $data{PROPERTY}{DOMAIN} }; for (@domains) { print "$_\n"; } # Same w/out intermediate array: # print "$_\n" for @{ $data{PROPERTY}{DOMAIN} }; __END__ a.com b.com c.com

See also:

Replies are listed 'Best First'.
Re^2: Datastructure access
by slatibart (Sexton) on Oct 27, 2014 at 14:06 UTC
    Thank you very much. Helped me to understand a fundamental mistake I had.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2019-11-21 21:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (105 votes). Check out past polls.

    Notices?