radix:~/tmp/section-lottery> cat data/sec.1.csv sec1,1 sec2,45 sec3,9 sec4,0 sec5,0 "section six",3 section999,10 radix:~/tmp/section-lottery> cat data/prefs.1.csv 1234,sec1,sec3,sec5 2345,"section six",sec2 5678,sec5,sec4,sec3,sec1,sec2,section999 4,sec1 5,sec1,"section six" 6,sec1 radix:~/tmp/section-lottery> ~/cvs/working/code/perl/section-lottery.pl -s data/sec.1.csv -p data/prefs.1.csv Number of sections: 7 Number of students: 6 Looping over all permutations (or untill a perfect one)... Trying combinations of size 1 Found new solution with 2 leftout: 3 Found new solution with 1 leftout: 4 Found new solution with 1 leftout: 4 Trying combinations of size 2 Trying combinations of size 3 Trying combinations of size 4 Trying combinations of size 5 Trying combinations of size 6 radix:~/tmp/section-lottery> ls *.csv 1-4-5201-1105570785.csv 1-4-8697-1105570785.csv 2-3-7313-1105570785.csv radix:~/tmp/section-lottery> cat 1-4-5201-1105570785.csv "sec1","0" "sec2","45" "sec3","7" "sec4","0" "sec5","0" "section six","1" "section999","10" "" "6","99999","","sec1" "2345","1","section six","section six","sec2" "4","1","sec1","sec1" "5678","3","sec3","sec5","sec4","sec3","sec1","sec2","section999" "1234","2","sec3","sec1","sec3","sec5" "5","2","section six","sec1","section six"