Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Mystery (to me) Data Structure

by poolpi (Hermit)
on Mar 31, 2008 at 10:42 UTC ( [id://677497]=note: print w/replies, xml ) Need Help??


in reply to Mystery (to me) Data Structure

my $hashIPs = {}; $hashIPs->{$ip} = { totalVulns => $ipTotalVulns, vulns => $vulns }; + $hashIPs->{$ip}->{'region'} = $region;

hth,
PooLpi

Update:

Or without references : my %hashIPs; $hashIPs{$ip} = { totalVulns => $ipTotalVulns, vulns => $vulns }; $hashIPs{$ip}{'region'} = $region;
'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Replies are listed 'Best First'.
Re^2: Mystery (to me) Data Structure
by jfraire (Beadle) on Apr 01, 2008 at 04:29 UTC

    Clarification: $hashIPs{$ip}{'region'} = $region; is still using references. It's just that the arrow operator is optional between bracket subscripts, according to perlref.

    Julio

    Update: And this is really nice when working with arrays of arrays, since they are then used as multidimensional arrays: $array_ref->[$x][$y] or $array[$x][$y].

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found