1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/perl open F, "packdrake -c @ARGV | hdlist2groups - |"; foreach (<F>) { chop; /(.*):(.*)/; $l{$2}{$1} = undef; } close F or die; foreach (sort keys %l) { print "$_\n"; print "\t$_\n" foreach sort keys %{$l{$_}}; print "\n"; }