http://www.perlmonks.org?node_id=363077


in reply to join on 6 huge files

unix utilities sort and join should do the work for you. Are the rows in each file unique and sorted? Depending on requirement use sort with  -u option. You may want to check out  -y option too.

Replies are listed 'Best First'.
Re^2: join on 6 huge files
by pbeckingham (Parson) on Jun 10, 2004 at 18:23 UTC

    Absolutely right. Doing this in Perl would be a waste of time if this is a one-off, and if there is no prior or subsequent processing. The only value is in implementing a merge sort, which is good practise I suppose.

    For Perl to sort, it first must slurp. The question of whether the input is already sorted therefore matters greatly.

    But our OP is absent, and hasn't responded to any questions. So given our lack of information, I agree with dba.