Parag Kalra wrote:
> # cat sort.pl
> my $column_number = 2; # Sorting by 3rd column since 0-origin based
> my $prev = "";
> for (
>   map { $_->[0] }
>   sort { $a->[1] cmp $b->[1] }
>   map { [$_, (split)[$column_number]] }

map { [$_, (split)[$column_number]] . " $_" }

>   <>
> ) {
>   print unless $_ eq $prev;
>   $prev = $_;
> }



-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to