in reply to Sorting issue

I'm not sure whether I understand what you want, but could it be as simple as:
open my FILE1, "sort -nk2 $input_file |" or die;
?

(2-arg open, because I can never remember whether I need "|-" or "-|" for 3-arg open; using 2-arg open beats looking it up in the manual).

Replies are listed 'Best First'.
Re^2: Sorting issue
by moritz (Cardinal) on Nov 04, 2011 at 21:30 UTC
    (2-arg open, because I can never remember whether I need "|-" or "-|" for 3-arg open; using 2-arg open beats looking it up in the manual).

    Just imagine the - being replaced by the program name. So |- is like |consumer (and you can write to the file handle in your Perl code), and -| is like producer| (and you can read from the file handle in your Perl code).

      Yeah, and that's so very confusing. See, for me, '-' just screams STANDARD (IN|OUT)PUT. So, '|-' just looks like I get to read from the programs standard output, and '-|' means I get to write to the programs standard input. Which is just the other way around of what it really is. :-/
        ++ I'm with you on that. '-' has been ingrained as STANDARD into my Unix subconscious.