Ok, last shot at this :-)

use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die',Input_Log=>'o +ut.txt',Prompt=>'/.*tstbld.*/'); $telnet->open('seahawk'); $telnet->login('tstbld', 'vilc0n'); $telnet->cmd(String=>'cd /builds/htpc2003r1/base/menu', Prompt=>'/.*ht +pc.*/'); $prompt = '/seahawk\:\>/'; @ret= $telnet->cmd(String=>'who', Prompt=>$prompt); print @ret;

from perl doc....

In a list context, just the output generated by the command is returned, one line per element. In other words, all the characters in between the echoed back command string and the prompt are returned. If the command happens to return no output, a list containing one element, the empty string is returned. This is so the list will indicate true in a boolean context. On time-out, eof, or other failures, the error mode action is performed.

Sorry I can't be of more help.. :-)

...the majority is always wrong, and always the last to know about it...


In reply to Re: Matching prompt in Net::Telnet by wjw
in thread Matching prompt in Net::Telnet by kkarne

Title:
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, details, 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, summary, 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.