in reply to Work with 2 socket

use IO::Select if you want to hand-roll a solution to simply watch two handles simultaneously, or POE to keep from reinventing all the eventual stuff you'll add above that (line-breaking, other processes, protocols, etc).

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.