[ale] Redirecting STDOUT in perl to a socket

Christopher Fowler cfowler at outpostsentinel.com
Wed May 12 08:22:32 EDT 2004


I've done the fork before I attempted the redirect.

On Wed, 2004-05-12 at 07:32, Geoffrey wrote:
> Christopher Fowler wrote:
> > I've created a socket from a client usins:
> > $client = $server->accept();
> > 
> > I'm trying to redirect 0,1,2 with the following code:
> > 
> > *STDIN = $client;
> > *STDOUT = $client;
> > *STDERR = *STDOUT;
> > 
> > If I stay in the perl program all output goes to the socket.
> > The minute I do exec() the output goes to the TTY.  What is the correct
> > way to redirect those so they follow during an exec()?
> 
> As in C, might you need to do a fork() first?  Running through perldoc 
> -f exec() I don't see that it has the same functionality as 'man 3 
> exec()' as perl exec() uses the shell to parse it's args.
> 
> Just a lot of guessing here as I've not played with exec() in perl (yet).



More information about the Ale mailing list