in reply to Re^2: Finding connected components in a graph.
in thread Finding connected components in a graph.
Yes. The subgraph is an array reference. Dig in! foreach my element (@{ $subgraphs[0] }) {...}
As expected, the last index in your two element array is 1. The other index is 0. As I wrote, you want to print 0+@subgraphs, or more explicitly, scalar(@subgraphs).
|
|---|