On Nov 23, 2011 4:50 AM, "Arvind" <arvind....@gmail.com> wrote:
>
> I have to write a perl script that keeps track of tcp connections.  I
> plan to keep track of this in an array of the form
> tcp_connection[source address][dest address]
>

I would just use a db for this if not only for the audit trail. I do
believe that postgresql has a field type just for you. Also, if you're
conserned about speed here you might look into rrd (disclaimer, I don't
know how good the cpan module is).

Also, if you want to use perl, I would go ahead and assign your full array
(the size ain't going to change with ipv4) and assign references to the
values that hold the data. But if you go this route, you're going to need
to loop through the whole thing to figure out who you've seen which might
be a bigger slow down in your process. Now, if your question is only 'have
I seen this before' this might be ideal. I however think you've got a
bigger question you're asking which is why I started by saying to look
elsewhere.

Reply via email to