in reply to Transposition of each letter pair in string
A bit nasty, since I'm fiddling with the pos, but it does the trick without modifying the original string and temp variables:
my $str = "thisisatest"; while ($str =~ /(.)(.)/g) { print "$`$2$1$'\n"; pos($str)--; }
Just my 2 cents, -gjb-
|
|---|