http://www.perlmonks.org?node_id=1004979


in reply to Re: rotate a vector with a regex?
in thread rotate a vector with a regex?

local $_ = '12345'; while( /(?=..)/g ) { my $pos = pos(); s/\G(.)(.)/$2$1/; pos() = $pos + length($2); } print $_, $/ __END__ 23451

- tye