Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Telnet Issue

by ssandv (Hermit)
on Sep 03, 2009 at 18:38 UTC ( [id://793272]=note: print w/replies, xml ) Need Help??


in reply to Telnet Issue

Monks tend to be a lot like computers. The more precisely you follow the directions, the better the results you tend to get. The stuff below the posting box that says to use <code> tags isn't really just a suggestion--surely you looked at the preview and saw it was unreadable?

In any event, since you didn't use Net::Telnet (perhaps you should explain why you're not using it), you can't then use the methods contained in Net::Telnet. What makes you think $telnet =  `telnet $hostname`; is anything like use Net::Telnet;$telnet = new Net::Telnet (...);? Backticks execute the string in a subshell and return the output. They don't give you a handle to the process. Note that you have a problem here because you're doing a blocking read on a telnet, which is in turn sitting there waiting for some input.

The analogous set of steps to reproduce Net::Telnet's actions would be something like: Open a socket. Fork. Arrange the socket to allow 2-way communication between the two processes. Have the child process exec telnet. Have the parent print commands through the socket to the child and read the output back. Properly close the telnet connection and terminate the child.

Now doesn't it sound easier to use Net::Telnet?

Replies are listed 'Best First'.
Re^2: Telnet Issue
by jag (Initiate) on Sep 04, 2009 at 15:34 UTC
    Sorry sandy to bother you, from where can i download Net::Telnet module for perl version v5.8.4. Could you please let me know.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://793272]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-23 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found