in reply to Refactoring nested if block

OK, so here are my responses.
  1. @cur_spin == $row_length: this was in fact a bug in my code, i.e. it checked it, then added to @cur_spin ... I fixed it by changing the $row_length to 15*159+1. Although I think both of the versions above will probably be more efficient, I want to use a working version of my original code as a baseline.

  2. Golfing: Hm, well, although there are really no departmental or corporate coding standards for perl, I'm trying to go by a sensible guideline. It's most likely someone's going to try to use my code in the future, and my department doesn't really use perl, so they'd be learning it on the fly. I'd rather leave code that makes sense to them, not only as a service to them, but also so they might be interested in using perl themselves. That said, since the concept of major and minor frames is something the rest of my coworkers use regularly, I'm going with a shortened but not too short format of $major and $minor.

  3. Indices are not necessarily numeric, so I can't optimize that. I wish I could, but there are other anonymous hashes I put in $ref_data that are specific to each frame, but are indexed by a alphanumeric string, not a number. I need these hashes for other data analysis subroutines.

  4. Wonky logic... Yup, I know some of that needs explaining. The third minor frame data being equal to 165 and each row starting at a multiple of 10 is something I (or, well, my customer) knows about the data. I know it's somewhat arbitrary, and put in comments to that effect. As requirements may change in the future, this is the sort of thing I'm figuring on including later on, writing code to read in parameters from a config file using Getopt::Long, creating a hash that would be accessed as needed.

  5. sorting results: Yes, that was another bug, albeit a minor one, which I fixed. Thanks for pointing that out.

  6. From xdg's post -
    This kind of assumes that you can generate a row name in a subroutine from the row itself other than with all those indexes.
    -------------------
    Hm, since the output of find_row_name would simply be $filename,$major," . $minor++, I'm not sure if it increases the readability that much.

    If you really want/need the indexes, then you'll have to do something more like what you've got with all the indices and looping instead of the way I've done it with map.
    -------------------
    Maybe. I do like this algorithm, but the only thing is, I need the value of each key where a row starts, i.e. each minor frame key and each major frame key. Especially since these keys are not necessarily sequential, nor are the same as the corresponding values of each key, as you say, I need to iterate as I do in my original code.