The program itself still doesn't run, I removed the main() section, and just opened a file with filehandle DATA, it runs with some errors. So some more clean up is needed.
Your explanation helps, can you give the desired output for that input data? and what output you're getting from the $statgrp (i.e, how you want to extract the output from $stargrp?) I'm a little unsure what you expect for the 409... case (Is the fifth row's 'FF' supposed to be 'FT'?)
Just a remark, while it's interesting to see a real problem in criminal justice, please don't assume we know the terminologies, which is usually the blocking issue for the rest of us. For example, I assume the first column is "statue", the second column is "degree", and third column is "case type". You want a shortest statue and degree combination that determines a case type. Am I right?
Comment on Re: Creating Minimal Subgroups in a List of Characters
Thanks for your comments. Sometimes when you've been working a problem closely, it is hard to see what isn't obvious to others. It is tough walking a line between being too technical and too vaugue. How do you simplify the issues without losing some essential element particularly on the edge cases. You're statement of the problem is a good one, however, "How to find the shortest statute and degree combination that determines the case type" is short, pithy and to the point. A lot better than my minimal subgroups ... title eh ;o)
It was actually while cleaning and simplifying the code that I hit upon the algorithm I utimately implemented. Thanks for helping me get focused.
PJ
use strict; use warnings; use diagnostics; (if needed)