Benchmarking is left as an exercise... ;)$_ = 'This is a test'; my @words = split; my @wordpairs = map {[ $words[$_-1], $words[$_] ]} 1..$#words;
Update: oops! I failed to notice that Joost already provided this solution. (I should have expected that he would.) Apologies for being redundant.
In reply to Re: Regex Word Pairs
by graff
in thread Regex Word Pairs
by logie17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |