On Tue 2006-03-14 ts wrote:
> >>>>> "T" == Tobi Reif <tobiasreif / pinkjuice.com> writes:
> 
> T>   $ ruby -pe 'sub(/(\S+)\s+(\S+)/,"#{$2} #{$1}")' data.txt
> 
>  The replacement string is build when #sub is called
> 
>  for the first call $1 = $2 = nil ==> the replacement string is ' '
> 
>  for the second call, $1 = 'first', $2 = 'foo' ==> the replacement string
>  is 'foo first'
> 
>  etc,

Thanks. I guess my (current) opinion is that it should work.

Tobi