in reply to creating adjacency matrix

CPAN has several relevant modules. It depends on what you want to do with your graph, I assume the adjacency matrix is just the starting point. The most obvious choice: Graph::AdjacencyMatrix. It gives you additional functionality that you will probably need anyway. Take a look at the Graph modules!

Cheers

Harold