# Find the number of vertices my @L; for my $i (0 .. $#S) { for my $j (0 .. $#{$S[$i]}) { push(@L, $S[$i][$j]); } }