Assuming the test harness provided, I doubt anyone can
beat this:
sub f{d,c,b,a,f,e}
Try this for a test harness:
my @list = (
a => [ 'b', 'c', 'e' ],
b => [ 'd' ],
c => [ 'b', 'd' ],
f => [ 'a' ],
);
print join (',', map { "'$_'" } f(@list)),"\n";
Your code produces 'd','b','c','f','e','a',
which does not reflect the fact that 'f' depends on 'a'.
So, I am afraid your solution holds only for a limited
set of test harnesses -- and is certainly not the shortest
among such solutions.
The Sidhekin
print "Just another Perl ${\(trickster and hacker)}," |