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.
In reply to Re: "Intelligent" array joining
by dragonchild
in thread "Intelligent" array joining
by ngomong
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |