I am trying to run the code what you have mentioned. But this is resulting in "List form of pipe open not implemented at... +sort.pl line 19"(on my windows system).I came to know that "List form + of pipe open "is not supported on windows system. and I changed it t +o open $fh, "|sort $filename", or die; and the entire code looks like this: use strict; use warnings; my $filename = "sort_input"; my $fh; my $line; my $key; my $value; my $prev_key; my $prev_value; my $file_consolidated_sort= "sort_output"; my $FH_sorting; #open $fh, '-|', 'sort', $filename or die; open $FH_sorting, ">>$file_consolidated_sort" or die "$!"; open $fh, "|sort $filename", or die; chomp( $line = <$fh> ); ($prev_key, $prev_value) = split /,,/, $line; while (<$fh>) { chomp; ($key, $value) = split /,,/; if ($prev_key eq $key) { $prev_value .= $value; } else { print $FH_sorting $prev_key ,, $prev_value; ($prev_key, $prev_value) = ($key, $value); } } print $FH_sorting $prev_key,,$prev_value; close $fh; close $FH_sorting; Another point is that I am not able to write the resulted output to th +e output file handler.All sorted output is getting printed on the scr +een itself with the warning/error on screen "Use of uninitialized val +ue $line in chomp at line 25, 26 etc". I have not tried sorting with huge file(3GB) which is my actual requir +ement and have not tested for performance will improve or not. Parelelly I am looking into external sort

In reply to Re^4: perl ST sort performance issue for large file? by rkshyam
in thread perl ST sort performance issue for large file? by rkshyam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.