Thanks everybody for you help. That code is exactly the kind of thing i was looking for. To Netwallah, it also sounds like the task for which it was used is similar to what i intend to do.This is the first time the task has been performed.
Basically i am going to collect the arp table off our router and hopefully the switch forwarding tables off our hp switches. the output of both things were then going to be inserted into a databse (i have a script to put the output into an sql database) which would be periodically updated so as to give an idea of what is on our network at any given time.
The database would have a record for each address with fields such as the related mac or ip address, the port that the mac address relates to( i forsee this could be difficult) and when it last appeared on the network.
so to get to the point, how difficult would it be to change Netwallah's script to do all these things? I would also be interested in seeing what the DBinterface module does as this may be better then adding more code to put the resulting output into an sql database.Any ideas netwallah? sorry for the long winded post but i am very new to this perl malarky and am still trying to find my feet.Once again thanks for all the replies so far.