Re: Net::Telnet $prematch, $match



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().


[...]

.



Relevant Pages

  • Net::Telnet $prematch, $match
    ... I am looking at a code fragment that I dont understand properly. ... crash out - cannot go on ...
    (comp.lang.perl.modules)
  • Re: Foiffant! (was: Gasflow along surface)
    ... The pulp pix index is $ 646 per ton soft white pulp from FRASER ... ALL the above are facts and sourced. ... You dont think like I do. ... The math predicted it on a dime befor it started then exceaded it I ...
    (sci.physics)
  • Re: No arbitrageur could possibly be slower or dumber than I am now.
    ... I will post allot of smaller matches I dont nead because Im lookng fr ... 20000 tons a stop on 100,000 ton boats and all 12 of mine. ... Just went down the beach with a loader ad hauled driftwood down the ... on my first ship. ...
    (sci.physics)
  • Re: I love Seattle and the Tongass, more than anywhere else.
    ... I dont load 3500 trucks to get a load on. ... It dont cost me 14 bucks a ton to get my log to my mill. ... Its alleady hot and the roller adds heat so I dont use the queeze dry ...
    (sci.physics)
  • Re: sawtooth g4 upgrade
    ... I am wanting to upgrade the processor but dont want to ... spend a ton of money on this 9 yr old machine. ...
    (comp.sys.mac.hardware.misc)