perlseeker19 has asked for the wisdom of the Perl Monks concerning the following question:

hi monks

i need to know whether IPC::Run can be used to spawn a telnet session and send some commands to it and display their output

i came across Net::Telnet and used it. it works.

but i need to know whether thi implentation is possible through IPC::Run

below is my code

#!/usr/bin/perl use IPC::Run qw(start pump finish timeout) ; my $server_address ='192.168.166.100'; my @cat = qw(cmd.exe); my $user_name = 'anitha'; #my @cat = qw(cmd /k telnet $server_address); my $h =start(\@cat, \$in , \$out); #pump $h while $out=~/.*>/i; $in .="telnet 192.168.166.100"."\n"; pump $h until $out=~/login:/i; $in .=$user_name."\n"; pump $h while $out=~/password .* /i; "before passwd\n"; $in .="9888888"."\n"; pump $h while $out=~/[.*]$/; $in .="help"."\n"; pump $h while $out=~/[.*]$/; print "$out\n";

so while executing its waiting indefinitely, pl help me out in this regard. tell ur valuable guidelines.... thanks

Replies are listed 'Best First'.
Re: ipc :: run & telnet
by Corion (Patriarch) on Aug 01, 2008 at 09:47 UTC

    What have you done to identify where your program is waiting indefinitely?

    Have you looked at the debugging facilities IPC::Run offers?

    We don't write your programs for you and if you don't supply us the information we need, we can't help you debugging your programs for you either.