You don't need to waitfor() the prompt. Just use cmd() and Net::Telnet will
automatically stop reading at the prompt. The prompt will not be included in
the return value of cmd().

This, of course, assumes you've specified the prompt correctly. If this is
your problem, you can use the nice debugging features to help you track this
down.

--
Mark Thomas
[EMAIL PROTECTED]
for($r=-1;$r!=38;$c++){print"\n"," "x(38-$r+++($c=0))if($c>$r);print~$r&$c?"
`":" #";}

> -----Original Message-----
> From: Allegakoen, Justin Devanandan 
> [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, April 12, 2002 6:06 AM
> To: '[EMAIL PROTECTED]'; 
> [EMAIL PROTECTED]
> Subject: pattern match timeout error using Net::Telnet
> 
> 
> Hello all,
> 
> I'm using the Net::Telnet module on a SunOS based
> system to run a program that resides on a
> Windoze 2k server.
> 
> By use of the log, I have determined that
> connection, and login are fine.
> 
> But I keep getting a pattern match timed-out error.
> 
> According to the Help, it relates this to
> matching the prompt and it states: "If the pattern chosen 
> doesn't match what's sent, then it's likely those commands 
> will timeout. "
> 
> On a manual telnet session the command prompt is:-
> C:\>
> 
> In my program I set my prompt as :-
> $obj->prompt('/C\:\\\>$/');
> 
> I follow that by :-
> $obj->waitfor('/C\:\\\>$/');
> 
> And there's where it times out.
> 
> Funnily enough if I remove the anchoring $ in the search 
> pattern the rest of the program will work, and the log will 
> even have the return of the command executed, but output from 
> the command won't go into the array I put it in (I get a 0 
> element array instead).
> 
> Obviously $obj->prompt needs a search pattern that works for 
> the rest of the program to. Question is what is the search 
> pattern I need?
> 
> Oh, and using quot in Net::FTP doesnt work either.
> 
> Just in
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list 
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to