Expect - Re: Expect_before amd expect_affter with perl and expect.pm

Posted on Mon Feb 6 12:34:12 2006 by rgiersig in response to 1669 (See the whole thread of 3)
Re: Expect_before amd expect_affter with perl and expect.pm
Short answer: I didn't need exp_before and exp_after (I prefer to use the callback style and write out all the possibilities explicitely), so I didn't invest anything into the code (just took the code that Austin had written).

How about writing it like this:
$exp->expect(2, [ "assword", sub { $exp->send("$password\r\n"); } ], [ 'timeout', \&timeout ], [ 'eof', \&eof ], );
Direct Responses: 1898 | Write a response