in reply to Print all possible paths in a graph and some graph creation too!
CPAN::graph seems to be the thing you want to look at. It will give you some basic functionality for storing graphs and lots of functions to work on them.