Chas. Owens wrote:
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
Or read the original paper at:
http://sysarch.com/Perl/sort_paper.html
John
--
Those people who think they know everything are a great
annoyance to those of us who do. -- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/