Subject: | successors() fails without stringify() |
Using Graph 0.50 on perl 5.8.4 built for i386-linux-thread-multi, on Linux 2.4.18-1-686 (Debian woody)
I have not been able to make a nice clean test case to reproduce this problem, but I have a complex script which produces different output from $graph->successors() depending on whether $graph->stringify() has been run first or not; when it has not been run first, successors() returns undefined, as illustrated in this output from the perl debugger stepping through the script.
Here is the relevant part of the script:
print "think Linking Rooms\n";
#$graph->stringify; # Fix for Graph 0.50 bug?
foreach (@rooms) {
print "\@tel [v($base$r{$_})]\n";
# Open all exits leading from the room
foreach $neighbor ($graph->successors($_)) {
$exit = $graph->get_edge_attribute($_,$neighbor,'label');
With $graph->stringify commented out, the script does not produce all the successors. Here's what perl -d shows just before the foreach $neighbor line:
DB<3> p $_
Town Square
DB<4> p $graph->successors($_)
DB<5> p $graph
City Gates-Town Square,Main Street-Sewer,Main Street-Town Square,Town Square-Cit
y Gates,Town Square-Main Street
DB<6> p $graph->successors($_)
Main StreetCity Gates
Something is being done in stringify that affects the graph beyond just returning a string rendering, I think (or something isn't being done in successor that needs to be?)
Best, Alan