U should use the DumpLog constructor option. That captures a raw log of the communication so u can see what is actually being sent and received. I've had to refer to it numerous times to get my statements working.
At 05:48 PM 11/30/2009 -0800, James T. wrote: >Hi all, > >Is there a way to run a script that take standard input. >My remote script is called 'restore'. When it is run , it require a "Yes or NO" answer before it can run" >My Perl program telnet find but cannot seems to pass the "Y" or "N" for the restore script to run. > > >use Net::Telnet; > >$ip = "hulk"; >$user = "user102"; >$password = ""; > > print "Running ...\n"; > $t = new Net::Telnet(-Timeout=>36000,-Errmode=>"return"); > $t->open($ip); > $t->waitfor(Match=>'/login/i'); > $t->print("$user"); > $t->waitfor(Match=>'/Pass/i'); > $t->print("$password"); > @pass=$t->waitfor(Match=>'/%/'); > > $t->cmd('cd TOOLS'); > $t->print('restore'); > $t->waitfor(Match=>'/Are you sure/i'); > $t->print("y"); > > -- REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=-- "...ne cede malis" 00000100 _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs