Man that's really weird. Success works pretty good, but failing gracefully is still my bugaboo. I still get the "Sorry" prompt, unless I change the key from a regex to a string match. And even then, if I don't have an actual "die" in the subroutine (that dies as it should), I still get the prompt. I don't really want the program to die, I just want to sever the connection and move on to the next machine, for example.
It makes me wonder if it isn't coming up in some other sort of context or something. I tried adding multiline and global match commands after the regex but Expect didn't like that at all:
Variable "$expect" is not imported at ./test.pl line 28.
(Did you mean &expect instead?)
Very weird.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.