http://qs1969.pair.com?node_id=457944


in reply to Re^4: In search of an algorithm for loading cyclic graphs
in thread In search of an algorithm for loading cyclic graphs

So, the links are literally that - actual weblinks. *ponders*

Either way, it doesn't matter. Create a links table and load that after loading all the nodes in their various types. That's the cleanest solution. Loading the links at the same time as the nodes is going to run into problems with cycles. But, you already knew that.

An alternate solution is what Data::Dumper does and that's to keep track of what nodes have been seen before and stop following the tree when you find somewhere you've been. I don't know if that will work, given the code you've already written.


  • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
  • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"