> -----Original Message-----
> From: Balint, Jess [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 26, 2002 3:11 PM
> To: 'Bob Showalter'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: Opening a shell with perl.
> 
> 
> How would script a hookup st in/out/err to the socket? 

Assuming $sock is an IO::Socket object:

   my $n = $sock->fileno;              # get file descriptor number
   open(STDIN, "<&$n") or die $!;      # dup the descriptor
   open(STDOUT, ">&$n") or die $!;
   open(STDERR, ">&$n") or die $!;

cf. perldoc perlopentut

do this after the fork, but before the exec.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to