8 my ($n1, $n2) = split /-/;
20 $visited{$_}++ for grep { /[a-z]/ } @path;
21 my $two = grep { $_ == 2 } values %visited;
23 for my $node (keys %{ $g{$here} }) {
24 next if $visited{$node}
25 && ($two || $node eq 'start' || $node eq 'end');
26 my $p = join('-', @path, $node);
27 next if $subpaths{$p}++;
29 push @paths, [ @path, $node ];
30 say join('-', @path, $node);