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).
In reply to Re^3: Finding connected components in a graph.
by SuicideJunkie
in thread Finding connected components in a graph.
by zing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |