Perl equivalent to the following shell operation.

G

grocery_stocker

I'm analyzing a really large file. While I was bringing in carts at
work, I figured it would be easier/more efficient just to split the
file, sort it in parallel, then merge it. If I wrote a shell script, I
would do something like the following:

#This code is duped from a google search
(cat list1 list2 list3 | sort | uniq > list123) &
(cat list4 list5 list6 | sort | uniq > list456) &

wait

diff list123 list456

However, I'm writing this in Perl because it would be easier to sort
the file using the Schwartzian Transform method. Is there an equivalent
in Perl or would I have to use some kind of existing Perl mod?

Chad
 
G

grocery_stocker

grocery_stocker said:
I'm analyzing a really large file. While I was bringing in carts at
work, I figured it would be easier/more efficient just to split the
file, sort it in parallel, then merge it. If I wrote a shell script, I
would do something like the following:

#This code is duped from a google search
(cat list1 list2 list3 | sort | uniq > list123) &
(cat list4 list5 list6 | sort | uniq > list456) &

wait

diff list123 list456

However, I'm writing this in Perl because it would be easier to sort
the file using the Schwartzian Transform method. Is there an equivalent
in Perl or would I have to use some kind of existing Perl mod?

Chad

Never mind. I entered the world 'parallel' in the search box thingy and
google magically turned up the answer.
 
D

Dave

grocery_stocker said:
Never mind. I entered the world 'parallel' in the search box thingy and
google magically turned up the answer.

I'm not sure why use say it 'would be easier to sort the file using the
Schwartian Transform method'. This method does not make it easier, in fact
it makes the code more complex that simply sorting, but with the advantage
of efficiency where re-calculating values is involved at each comparison.
This would not be the case in the simple sort above.
 
D

Dave

Dave said:
I'm not sure why use say it 'would be easier to sort the file using the
Schwartian Transform method'. This method does not make it easier, in fact
it makes the code more complex that simply sorting, but with the advantage
of efficiency where re-calculating values is involved at each comparison.
This would not be the case in the simple sort above.

s/use/you/;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top