in reply to nested hashes and their usage e.g $foo{bar}{baz}

foreach $srcip (keys(%srciphash))
This iterates through the keys of the hash %srciphash where each key is assigned to $srcip
foreach $dstip (keys(%{$srciphash{$srcip}}))
This iterates through the hash stored in %srciphash associated with the the key $srcip, the cluster of curly braces is dereferencing the stored hash, then assigning the keys of that hash to $destip.
$srciphash{$srcip}{$dstip} = 1;
This assigns 1 to the value corresponding to the key $dstip which is within a hash stored in %srciphash corresponding to the key $srcip.

Hopefully this code should clarify the above statements.

my %srciphash = ( foo => { one => undef }, bar => { two => undef }, baz => { three => undef }, ); foreach my $srcip(keys %srciphash) { foreach my $dstip(keys %{ $srciphash{ $srcip } }) { print "$srciphash{$srcip}{$dstip} = 1\n"; } } __output__ $srciphash{foo}{one} = 1 $srciphash{baz}{three} = 1 $srciphash{bar}{two} = 1
See. perldata and perlsyn for more info on data structures and looping syntax.
HTH

_________
broquaint