Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: How do I get expect.pm to ignore special characters?

by FreeBeerReekingMonk (Deacon)
on Apr 15, 2015 at 20:08 UTC ( #1123560=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I get expect.pm to ignore special characters?
in thread How do I get expect.pm to ignore special characters?

Well you could return values:

$ssh->expect(5, '#') or return "ERROR"

You can also lower the amount of timeout, 60 is ok while you make the initial handshake connection, but you must have a WAN if you need to wait 60 seconds for the other prompt. Any way; and at the end of the subroutine:

return "OK"; }

Then in your main loop, you pick that value up:

for my $server (@servers) { # do your thing with $server $rc = change_password($server); if($rc eq "ERROR"){ die "PANIC for $server"} }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1123560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2020-03-28 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (167 votes). Check out past polls.

    Notices?