469,357 Members | 1,623 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,357 developers. It's quick & easy.

Net::Telnet - Alternate Prompts

2
Hi
I'm working with Telnet object and using "Promt" as exected string:

Expand|Select|Wrap|Line Numbers
  1. %enterarr="String"=>"stopServer", "Timeout"=>$timeoutforsync, "Prompt"=>"/stop completed/", Errmode=>'return');
  2. @arry=$t->cmd(%enterarr);
  3.  
I would like "Prompt" to wait for 2 optional strings: "stop completed" or "allready stopped".

How do I represent it in the "Prompt" attribute?

Thanks.
Aug 8 '07 #1
2 1261
miller
1,089 Expert 1GB
Per the docs of Net::Telnet, I believe what you're looking for this is the following:

Expand|Select|Wrap|Line Numbers
  1. my @arry = $t->cmd(
  2.     String  => "stopServer",
  3.     Timeout => $timeoutforsync,
  4.     Prompt  => "/(?:stop completed|allready stopped)/",
  5.     Errmode => 'return',
  6. );
  7.  
- Miller
Aug 8 '07 #2
Gili
2
Thanks alot, i'm checking it.
Aug 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Pete Johansen | last post: by
1 post views Thread by kriz4321 | last post: by
1 post views Thread by jyohere | last post: by
2 posts views Thread by kriz4321 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.