how do i sort in a descending order using perl Sort::External Module

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ravikim1
    New Member
    • Nov 2009
    • 3

    how do i sort in a descending order using perl Sort::External Module

    Hi ,

    Code:
    use Sort::External;
    $output = '1.txt';    
    open(FILE, $output);
    my $sortex = Sort::External->new( mem_threshold => 1024**2 * 1024 );
    while (<FILE>) 
    {
       $sortex->feed($_);  # tried to change it to ~$_ but did not work !!!!!
    }
    use Fcntl;
    $sortex->finish(
            outfile => 'desc_Sorted_04323697_pbragg02@sprintpcs.com_.txt',
            flags => ( O_CREAT | O_WRONLY ),
    );
    close(FILE);
    with the above code the file is getting sorted in ascending order. how do i sort in descending order ?

    thanks in advance,
    ravikim
Working...