I am trying to code up a project for a class - the assignment is to create 3 separate processes, each reading from an individual file; an alphabetical list of names with no set length (in otherwords, the file list is presumed to be infinite). The processes must coordinate with one another to find the first name that is on all 3 lists.
Okay so enough with the details...
I am trying to have each process communicate via a pair of sockets (send and receive) respectively for each script. At present I have a total of 8 open sockets, two for First.pl, four for Second.pl (since it is the middleman) and two for Third.pl.
My issue is being able to read from two open receive sockets at the same time, for some reason I cannot seem to keep two open "receive" streams. Also I seem to have issues printing to STDOUT on a process while it has a socket-stream open to another process<\p>
Is there a more intelligent way of going about this?
If not, what are the pitfalls I may be stumbling across in my implementation?
I will post some code in the next hour or so - it's pretty mangled at this point (5am CST) and needs to be cleaned up before going public. In the interim, any advice would be much appreciated!
In reply to sockets and such in Perl by scotchfx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |