$s = 'This is the word'; $s =~ s[(^\S+)(\s.*\s)(\S+$)][$3$2$1]; print $s; word is the This
In reply to Re^3: How do I reverse the order of the first and last word of a string?
by BrowserUk
in thread How do I reverse the order of the first and last word of a string?
by ferrispike12
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |