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-
In reply to Re: Transposition of each letter pair in string
by gjb
in thread Transposition of each letter pair in string
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |