in reply to "Intelligent" array joining
use Graph::Directed; my @array1 = qw(dog cat rat mouse); my @array2 = qw(dog rat mouse bird); my @array3 = qw(cat rat fish mouse); my $graph = Graph::Directed->new; $graph->add_path(@array1); $graph->add_path(@array2); $graph->add_path(@array3); my @toposort = $graph->toposort; print "@toposort\n"; ------ dog cat rat fish mouse bird
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: "Intelligent" array joining
by ngomong (Sexton) on Feb 06, 2004 at 16:27 UTC | |
|
Re: Re: "Intelligent" array joining
by ngomong (Sexton) on Feb 06, 2004 at 14:37 UTC |