Net::Telnet $prematch, $match
- From: "ton de w" <ton_de_winter@xxxxxxxxxxx>
- Date: 12 Apr 2007 07:18:07 -0700
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
}
my ( $prematch, $match) = $telnet->waitfor('/password: $/i);
my($prematch, $match) = $telnet->print($password);
....
So what I do understand is line1 we wait for "login: " case
insensitive.
Then line2 supply the user - ($prematch, $match) not used at this
point.
line 3 - i am not really sure - $prematch contains the match up to
expression and $match the match expression but what is the if
statement comparing?
And how if we dont get the 'Choose new password' do we continue to
provide the password?
Actually I need to extend this program to do very similar things - is
there an alternative way of doing this?
TIA
Ton
.
- Follow-Ups:
- Re: Net::Telnet $prematch, $match
- From: Mumia W.
- Re: Net::Telnet $prematch, $match
- From: Jim Gibson
- Re: Net::Telnet $prematch, $match
- Prev by Date: Re: Log4perl module for cygwin newbie
- Next by Date: Re: Net::Telnet $prematch, $match
- Previous by thread: Re: Log4perl module for cygwin newbie
- Next by thread: Re: Net::Telnet $prematch, $match
- Index(es):
Relevant Pages
|
|