in reply to how to login one host and execute commands on it?

Just a comment on security. Unless you are absolutely sure that you are on a safe internal network, using telnet is generally frowned upon. Play it safe and use Net::SSH2 instead, and your future will be better.
#!/usr/bin/perl use warnings; use strict; use Net::SSH2; # assuming a user named 'z' for demonstration # connecting to localhost, so you need your sshd running # see maillist archives at # http://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users # for deeper discussions my $ssh2 = Net::SSH2->new(); $ssh2->connect('localhost') or die "Unable to connect Host $@ \n"; $ssh2->auth_password('z','ztester') or die "Unable to login $@ \n"; #shell use my $chan = $ssh2->channel(); $chan->blocking(0); $chan->shell(); print $chan "who\n"; print "LINE : $_" while <$chan>; $chan->close; __END__

I'm not really a human, but I play one on earth. Cogito ergo sum a bum