After the fact
I wrote a script which reads the OID tables, associates IPs to MACs, then for each switch lists all the ports on all the other switches that MAC is reachable to. Problem was it took almost two minutes to run, which was going to make testing algorithms slow and tedious.
So I decided I needed a database.
And I discovered that the only interface to databases provided by perl is the ugly pseudo-OO interface. And, well, Python followed from that.