Re: Net::Telnet $prematch, $match
- From: "Mumia W." <paduille.4061.mumia.w+nospam@xxxxxxxxxxxxx>
- Date: Thu, 12 Apr 2007 20:11:15 GMT
On 04/12/2007 09:18 AM, ton de w wrote:
Hello,
I am looking at a code fragment that I dont understand properly.
...
my ($prematch, $match) = $telnet->waitfor('/login: $i);
$telnet->print($user);
if (($prematch, $match) =$telnet->waitfor(string=> 'Choose a new
password'))
{
crash out - cannot go on
}
I'm assuming that the "errmode" is "return." When the second $telnet->waitfor() succeeds, the method will return a list containing values for $prematch and $match. If that happens, it means that the host is demanding a new password, and since the script can't handle that, it exits. The "if" statement tests whether a non-empty list was returned by $telnet->waitfor().
[...]
.
- References:
- Net::Telnet $prematch, $match
- From: ton de w
- Net::Telnet $prematch, $match
- Prev by Date: Re: Dialog
- Next by Date: Re: Dialog
- Previous by thread: Re: Net::Telnet $prematch, $match
- Next by thread: Dialog
- Index(es):
Relevant Pages
|
|