It appears that %srciphash is being used to associate source ips ($srcip) with their destinations ($dstip), so %srciphash is a hash which has the source ip as the key, and an anonymous hash as the value. The anonymous hash then contains the destination ip as the key, and '1' as the value. The first foreach loop iterates through the srcips (putting them into $srcip), and the second one iterates through all the destination ips associated with that source ip (putting them into $dstip). If you were to add print "$srcip talked to $dstip\n"; inside the last loop, it would show the relationship between the source and destination ips.
In reply to Re: nested hashes and their usage e.g $foo{bar}{baz}
by jasonk
in thread nested hashes and their usage e.g $foo{bar}{baz}
by Chris_LSU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |