Hashmat Khan wrote:
> On Mon, Aug 11, 2008 at 9:00 PM, Rob Dixon <[EMAIL PROTECTED] <mailto:[EMAIL 
> PROTECTED]>> wrote:
>> Hashmat Khan wrote:
>>>
>>> For the timeout, I used a very large value, so its solved !
>>>
>>> One more issue, when I use this:
>>>
>>>  @lines = $t->cmd($bldcmd)
>>>  ($prematch, $match) = $t->waitfor(Match => /Build completed on/ || /
>>> Build failed on/);
>>>
>>> I get this error:
>>> maximum input buffer length exceeded: 1048576 bytes at D:\Docs\Perl
>>> \scripts\
>>> ti_p2k_bld.pl line 33
>>>
>>> This could be because $prematch is gets a very big string and so it
>>> exceeds the limit which I had suspected before.
>>> Bottomline, I want to get the $match value. How can I do this ?
>> 
>> Please try to remember to bottom-post your responses to this group.
>> Thanks again.
>> 
>> You can disable the timeout by specifying a value of undef, for instance
>> 
>> my $t = new Net::Telnet (Timeout => undef);
>> 
>> You can't use waitfor like that. Regular expressions must be passed as
>> strings like '/Build completed on/' but I think it's neater to use the 
>> string option like this
>> 
>>   my ($prematch, $match) = $t->waitfor(
>>     String => 'Build completed on',
>>     String => 'Build failed on',
>>   );
> 
> ok...thanks.
> 
> what do you mean by bottom-post the response ?
> I am having one new problem,
> 
> when I use this: @lines = $t->cmd($bldcmd) ($prematch, $match) =
> $t->waitfor(Match => /Build completed on/ || / Build failed on/); I get
> this error:
> maximum *input buffer length exceeded*: 1048576 bytes at D:\Docs\Perl
> \scripts\
> ti_p2k_bld.pl line 33

Please keep your posts to the newsgroup rather than messaging me privately so
that others may help and learn from your questions. Thank you.

Bottom-posting means to put your response after the message you are quoting

  http://en.wikipedia.org/wiki/Bottom-posting#Bottom-posting

The waitfor method of Net::Telnet saves all data from the host until it finds
one of the conditions you specify in the call. If you have made a mistake in
specifying the conditions (which you have, as I explained in my previous post)
and disabled timeouts then data will be stored indefinitely without returning
from the call.

Without seeing your application I can't really tell, but it may be better to try
something like

  $t->waitfor(String => "\n")

and examine the build log line by line in your own code.

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to