Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: IPC Servers Keywords: IPC server perl Message-ID: <7036@jpl-devvax.JPL.NASA.GOV> Date: 9 Feb 90 16:52:49 GMT References: <1328@gapprd.gapos.bt.co.uk> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 33 In article <1328@gapprd.gapos.bt.co.uk> steve@gapos.bt.co.uk (Steve A Rooke) writes: : As a novice perl hacker (of a few days) I have been looking at the : interprocess communication and want to set up a server that will start : up a unix executable and attach it to the pipe for the duration of the : session and when finished the server will start `listening again'. : I see there is a command `select' that I can change stdout to the socket : file handle but I can not find the command to change stdin in the same : way. Select isn't doing what you think it's doing. What you want is probably socket(SOCK, ...); bind(SOCK, ...); listen(SOCK, 5); accept(NSOCK, SOCK); $pid = fork; if (!$pid) { open(STDIN, "<&NSOCK"); open(STDOUT,">&NSOCK"); close NSOCK; close SOCK; exec '/usr/lib/sendmail', '-bs'; # or whatever } $status = wait; ... Or some such. Larry