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


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

> rather, an intermediate string is being built up during this process, and the intermediate string is copied to the original string

I think you're right

DB<123> $x=join "",a..j => "abcdefghij" DB<124> $x =~ s/(.)(?=(.))/$2$1/g => 9 DB<125> $x => "bacbdcedfegfhgihjij"

Cheers Rolf