Note that \w includes letters, digits, and the underscore character. If the latter isn't acceptable, use a character class.$old .= (length($old) % 2) ? 'F' : ''; $old =~ s/\G(\w)(\w)/$2$1/g;
In reply to Re: Rearranging a string
by chromatic
in thread Rearranging a string
by muppetBoy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |