sunadmn has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -Tw # This is a wrapper script that will use Expect # to telnet to the VIP changer for PHX and roll # in and out of prod for service reasons use strict; use Expect::Simple; my $obj = new Expect::Simple { Cmd => "telnet my.host.com verbose=1", Prompt => 'Enter Password', DisconnectCmd => 'quit', Verbose => 0, Debug => 0, Timeout => 100 }; $obj->send( my $cmd ); print $obj->before; print $obj->after; print $obj->match_str, "\n"; print $obj->match_idx, "\n"; print $obj->error_expect; print $obj->error; my $expect_object = $obj->expect_handle;
I am lost and do not know where to go from here, does anyone have a beeter example of using this module??Expect::Simple: Expect::Simple: couldn't find prompt at ./vipPHX.cgi line 11 at ./vipPHX.cgi line 11 print() on closed filehandle GEN0 at /opt/HWPerl/lib/perl5/5.8.0/sun4- +solaris/IO/Handle.pm line 395. print() on closed filehandle GEN0 at /opt/HWPerl/lib/perl5/5.8.0/sun4- +solaris/IO/Handle.pm line 395.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect::Simple help
by TedYoung (Deacon) on Dec 02, 2005 at 21:46 UTC | |
by sunadmn (Curate) on Dec 05, 2005 at 13:56 UTC | |
|
Re: Expect::Simple help
by BMaximus (Chaplain) on Dec 02, 2005 at 17:50 UTC | |
by sunadmn (Curate) on Dec 02, 2005 at 18:32 UTC |