while(my @pair = splice @$r, 0, 2) { push @$r2, \@pair; }