Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[Your Mother]: Missiles would be an idiot’s play. Putin is many things but he is not an idiot.
[erix]: I like the idea of the trumps troup of imbeciles growing slightly nervous now their incompetence will be tested
[erix]: you seem forget there is another idiot coming :)
[Your Mother]: The US government does not attract talent, but grafters and liars and it has been that way for the better part of a century. FEW exceptions.
[erix]: you think it only /looks/ worse this time?
[Your Mother]: HR Clinton was literally threatening Russia. She would have been MUCH more likely to start real trouble.
[Your Mother]: I think there is less decorum this time.
[Your Mother]: We’ve had rapists and thieves and unqualified government. They just had decorum.
[erix]: heh, understatement of the week :)
[erix]: well, I hope you're right

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-01-20 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (173 votes). Check out past polls.