in reply to Net::Telnet while loop not exiting (Newbie Please be Gentle)
If we take the Net::Telnet internals as canon,
then maybe you should also test for the eof and timeout conditions.## Wait for login prompt. $self->waitfor(-match => '/login[: ]*$/i', -match => '/username[: ]*$/i') or do { return &$error("read eof waiting for login prompt") if $self->eof; return &$error("timed-out waiting for login prompt"); };
Obligatory nit: I don't think you need to escape the '-' characters if they aren't inside a character class, e.g. /--[!?]--/ )
|
|---|