in reply to Win32: best way to Input to external program
in thread Handling long command lines (was: Input to external program)

I know that the unix "sort" work on lines so perhaps you might need to replace :
print THING "$_ " foreach @unsorted;
by
print THING "$_\n" foreach @unsorted;

???

"sort" reads all the lines and sort them in memory (and using temporary files), then when it receive an EOF on STDIN (your close()) it print out the sorted lines.

Replies are listed 'Best First'.
Re: Re: Win32: best way to Input to external program
by smackdab (Pilgrim) on May 11, 2002 at 20:17 UTC
    aahh, this is why I like asking questions here...ya always learn something new ;-)