There may be a module that could help you here, but my preference would be to just roll up my sleeves and write to some Perl to do this. It sounds like there are two rules:
- Starting at some point on the list (and this point may process along the list), elements 0 to 4 must be monotonically increasing; and
- element 5 must be less than element 4.
And similarly for the other direction.
This would probably be a good interview question .. there are lots of different ways to do it.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.