http://qs321.pair.com?node_id=950377


in reply to Sliding window

This can help you to implement the sliding window:
$s = "abcdef"; print "$1,$2\n" while $s =~ /(.)(?=.(.))/g;
Update: Using while instead of for to simplify getting the pairs.