in reply to Re: How do I close a pipe
in thread How do I close a pipe

I am sorry about the FH name, I updated the post.

I added the SIG{INT} trap because without it when I send the signal (CTRL+C) the terminal session stays running, do you think that by closing the file handle (pipe) the telnet session is not being closed properly? (The server will never send EOF since it is always loggin data to the output)

Replies are listed 'Best First'.
Re^3: How do I close a pipe
by ysth (Canon) on Dec 14, 2008 at 06:34 UTC
    Per close, after the pipe is closed, perl will wait for the telnet process to complete and return its exit status in $?. Closing the pipe will result in telnet getting a SIGPIPE, which should cause telnet to terminate, but YMMV.