Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Problem with net::telnet

by joyeux (Initiate)
on Dec 06, 2012 at 05:30 UTC ( #1007472=perlquestion: print w/replies, xml ) Need Help??
joyeux has asked for the wisdom of the Perl Monks concerning the following question:

This is my code

use Net::Telnet $t=new Net::Telnet(Timeout =>100, Prompt => '/[\$?>:#\]]*$/'); if($t->open('192.168.1.200')) { print "connected"; } else { print "not connected"; } # if i give wrong user name and password also it didnt<br/> show #error msg $t->login('test','test123'); @lines=$t->cmd("ls"); # always prints 1 $t->close;
could plz someone help me

Replies are listed 'Best First'.
Re: Problem with net::telnet
by 2teez (Priest) on Dec 06, 2012 at 05:39 UTC

    Please, could you insert your codes within the tag <code>.You could also see this How do I post a question effectively?
    === UPDATE ===
    Please, if I may suggest that you always use strict and warnings in your scripts.
    Moreover, you can check EXAMPLE of this module usage in the Example section of the module.

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1007472]
Approved by rovf
help
Chatterbox?
and the fire pops...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2016-12-03 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.