Used within the test harness:sub f { my%s;%r=@_;map{$m{$_}={map{$m{$_}||={};$_=>1}@{$r{$_}}}}keys%r; reverse sort{($a->{$b})-($b->{$a})}keys%m; }
Returns the following list:#!/usr/bin/perl my @list = ( a => [ 'b', 'c' ], b => [ 'c', 'd' ], c => [ 'd' ], e => [ 'b', 'a' ], f => undef, ); print join (',', map { "'$_'" } f(@list)),"\n";
'd','c','b','a','f','e'
In reply to Re: (Golf) Dependency List Prioritization
by tadman
in thread (Golf) Dependency List Prioritization
by tadman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |