On Mon, Jun 15, 2009 at 12:15, John W. Krahn<jwkr...@shaw.ca> wrote: snip > The OP said they want to sort "by col2" so that should be sort { $a->[1] cmp > $b->[1] } snip
Yeah, I didn't read closely enough. snip > Or perhaps a GRT instead: > > perl -le'print for map join( "", reverse /(\S+)(\s+)(\S+)/ ), sort map join( > "", reverse /(\S+)(\s+)(\S+)/ ), <>' filename snip For those not familiar with the Guttman Rosler Transform (GRT for short), here is an article on it: http://www.perlmonks.org/?node_id=145659 -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/