473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

net::telnet Prompt and timeout issue

Any pointers on this truly appreciated.

I am using net::telnet to connect to a modem pool and then connect with a remote piece of kit. Everything works fine normally, however on occassions the remote piece of kit may be busy and will not talk to me, leaving me to logoff cleanly and try again later.

Using net::telnet and the following code I am trying to wait for the prompt of ? to be returned if it is not returned after 60 seconds I wisk to run a sub that will basically log me off the device cleanly (failure to do so can leave the device port hung stopping further access until reset).

Expand|Select|Wrap|Line Numbers
  1.                 $telnet->cmd(String => "$level",
  2.                         Prompt =>'/USER:$/');
  3.                 $telnet->cmd(String => "$user",
  4.                         Prompt => '/KEY:$/');
  5.                 $connected = $telnet->cmd(String => "$pass",
  6.                         Prompt => '/\?/',
  7.                         Timeout => 60,
  8.                         Errmode => sub{&prompterr($params)} );
The issue is that the code jumps straight to the errmode rather than waiting for the prompt or the timeout!!!

Can anyone point me in the direction as to where I have gone wrong? Have I completely misunderstood how to use this?!?!

Best regards

Steve
Jul 18 '08 #1
0 3474

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

Similar topics

0
by: Pete Johansen | last post by:
Hi Folks, This prompt statement has been a real pain in the the butt. I am using net::telnet(v3.03) to connect to a W2K box from a Solaris 2.6 box. I the output stream resulting from a 'dir'...
2
by: Vinay Gupta | last post by:
Hi, In a Perl to Tcl conversion project, I am planning to use the following Tcl extensions as a replacement for some Perl libraries. My development environment is Windows. Win32::OLE --> "DDE"...
1
by: kriz4321 | last post by:
Hi all, This is the code I use to login to any device.( I will not be able to see any window but it will be able to login to the device and give the command specified)... can you tell me what...
1
by: jyohere | last post by:
I want to login to a remote machine using Net::Telnet....then i want to move to a particular directory in that remote machine....after that i want to get a list of files under that directory....after...
0
by: shineyang | last post by:
Dear all: Who is kind to help me about the following problem. Why cannot log the remote node by using Net::Telent #################################### The following is normal to the process...
3
by: surajsingh | last post by:
Hi, I have a perl script which uses Net::Telnet module to open a telnet session with my unix boxes, and executes lot of commands on those boxes. As this module is implemented, when 'cmd' is...
2
by: kriz4321 | last post by:
Hello all i am using net:telnet module to login to the remote machine and execute some commands and to collect some logs corresponding to the command given. After loging into the machine I do...
2
by: jane007 | last post by:
Hi everybody, Anybody who know how to use Net::Telnet module to execute my own script?Not only to execute system command. Please advise. Thanks.
21
by: poolboi | last post by:
hi guys, a question on net::telnet what does this module do? cos i have a telnet client that will be able to communicate with a database so is it true if i enter my ip address, username, and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.