in reply to Column help

while ( <> ) { $_ =~ s|^(.*?\s){3}([^\s]*).*$|$2|; print $_ . "\n"; }
Appears to be about twice as fast as using split. At least, in my benchmark.

Replies are listed 'Best First'.
Re^2: Column help
by mhearse (Chaplain) on Oct 24, 2004 at 08:23 UTC
    Could you explain your regex? Is this a substitution?