Hi all, I am trying to do something here that is a little beyond my current perl knowledge and need a little assistance if thats ok. Im not necessarily asking for the code, more so just a suggestion on the best method to use to achieve my goal

I have a database query result like below (details from the db of all network interfaces on a particular box, in this case "server1" from yesterday)

Code:
SELECT hostname,nic_name,nic_duplex,nic_ip FROM network_table WHERE hostname = "server1"
server1|bge0|100|full|10.32.100.23
server1|bge1|1000|half|10.48.23.11
server1|bge2|100|full|10.45.6.78


I also have a local file which has the most recent information (todays) generated from server1 itself (output formatted the same)

server1|bge0|100|full|10.32.100.23
server1|bge1|1000|half|10.48.23.11
server1|bge2|100|full|10.45.6.79
server1|bge3|100|full|10.34.34.34

As you can see, a new interface "bge3" has been added/configured on server1 and the ip of bge2 has changed since yesterday

Im trying to find a way within perl of comparing the first batch of information with the second to see if anything has changed (so that i can update the database accordingly)

the change could be in either direction, i.e in the database but not in the file or in the file but not in the database


what would be the best way to compare these two sets of information, so that i can UPDATE (or INSERT/DELETE if required) the records in the database with any change that needs to be made.

Any help or advice on this would be greatly appreciated