in reply to how to terminate an IO:Socket Process prematurely?
Obviously because your while loop never terminates. After reading the first line of input, the $line = <$remote> blocks, waiting for more input that never comes.
Three notes:____________#!/usr/bin/perl -w use strict; use IO::Socket; my $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "210.212.226.195", PeerPort => "ssh(22)", ) || die "cannot connect"; sysread($remote, my $line, 4*1024) or die "couldn't read any data"; # +one single attempt to read 4k of data print "$line\n";
|
|---|