Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I just tried it out, and had a similar problem. Using the following code, I tried to connect to a local box:

#!/usr/bin/perl use strict; use warnings; use Net::Telnet; my @lines; my $t = new Net::Telnet( Timeout=>10, Prompt=>'/# $/', Dump_Log=>'NetTelnet_x.log' ); $t->open(""); $t->login("foo", undef); @lines = $t->cmd("ls"); print @lines;

It was hanging on the login, as you described. When it finally timed out, I got the message:

timed-out waiting for password prompt at ./ line 13

Well, my local box doesn't have a password on the foo account[1], so it never prompts for password. I just changed the login line to read:


and it started to work. Perhaps you have the same problem? (I notice that you don't quote the error message anywhere, so I can't tell. The one error message you *did* give was a match timeout from when you were playing with regular expressions.)

You might try logging in step by step with the cmd() function and verify that the login process is working as you expect. Then you can fix the login() call if you find a surprise.



[1] I don't run Telnet servers (except for the few minutes for this test), so 733t h@X0r2[1] need not get their hopes up...

[1] Synonym for "script kiddie".

In reply to Re^3: Net::Telnet blocks by roboticus
in thread Net::Telnet blocks by kp2a

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [choroba]: Email::Address DoS
    [Corion]: (that module has been deprecated by its author already, so that's fair. Although I wonder why the backtracking can't be fixed to handle the formfeeds gracefully)
    [choroba]: not enough tuits?
    [Corion]: choroba: Yeah, maybe. I'm also unaware of who uses Email:: modules, but that's more my limited horizon of things ;)

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (9)
    As of 2018-06-20 11:56 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (116 votes). Check out past polls.