in reply to Recommendations for perl modules to work on data sets ?

I don't know what pairwise does in python, but it sounds similar to pairs in List::Util. See also List::MoreUtils for pairwise and many other functions. On the other hand, I don't see how these functions can help you in getting the monotonic sequences.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,