All pastes #501124 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-21 21:40 UTC
rendered paste body
my $t = Graph::Traversal::DFS->new($g,

				   pre  => sub {push @pre,$_[0]},
				   post  => sub {
				       print join(',',@pre),"\n" if($g->degree($_[0]) == 1 && $_[0] ne $startnode); 
				       pop @pre;},
				   next_alphabetic=>1, # if you want output order to be deterministic, otherwise will display paths in arbitrary order
				   start => $startnode);