Hi,

Of course I need write some Telnet code in perl but i have some problems. My system support diffrent types of prompt with different functionality, so:

1. login prompt:

This computer resource is private property. Unauthorized access, misuse, and misappropriation of resources is prohibited by law. hapWibbSc2 login: root Password: Last login: Tue Jun 11 12:04:37 on ttyS0 root@hapWibbSc2:~#

2. 'linux' kind prompt root@hapWibbSc2:~#

3. agent prompt:

root@hapWibbSc2:~# cli Starting Agent CLI hapWibbSc2#

How to detect in which prompt am I, because there is different types of command in every.

And second problem when I grabbing out put of command sometime if output is longer it print "--More--" waiting for <space> key from user to print rest how to decect is and send <space> and grab rest of output.

i.e.

...pciConflictResolutionMode preview sendSortedEutraNeighbors true sen +dSortedCdma2000Neighbors true TinterFreqAnrMeasDuration 100 TreportStrongestCellsForSonEhrpd 1 +00 TreportStrongestCellsForSonOnex 100 sonAppLogEn able true anrModeEUtran disabled anrModeEhrpd disabled anrModeOnex dis +abled nrtMaxSizeEUtran 134 nrtMaxSizeEhrpd 134 nrt MaxSizeOnex 134 anrScoreOnexMin 5 anrScoreOnexMax 10 anrSco --More-- reOnexThresholdMax 20

Anyhelp will be grate!


In reply to Net::Telnet different prompts by emcek

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.