Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (25 sloc) 0.494 kb
my @load_graph = (
[ A => [
[ "B" ],
[ C => [
[ D => [
[ "E" ]
]
],
[ "F" ],
]
],
],
]
);
my @load_order;
sub walk_graph {
my ($node) = @_;
return unless ref $node eq "ARRAY";
for my $load (@$node) {
walk_graph($load->[1]) if ref $load->[1];
push @load_order, $load->[0];
}
}
walk_graph(\@load_graph);
print join $/, @load_order, "";
Jump to Line
Something went wrong with that request. Please try again.