This is the .pl that i use, where i put this sub??
use Net::Telnet (); $t = new Net::Telnet (Timeout => 5, output_log => "c:\DP\Perl\output.log", Host => "172.20.40.1"); #$t->open("172.20.40.1"); #$t->login($username, $passwd); @v1 = $t->cmd("\cY"); print @v1; @v2 = $t->cmd("c"); print @v2; #$t->print("\cY"); #$t->print("c"); @v1 = $t->cmd("sh ip"); print @v1; @v1 = $t->cmd("exit"); print @v1; print "l"; $t->close; exit;
I donīt understand the reference?? This script will leave unattended, i not sure that "sub ctrl" do that i want, or maybe i donīt give a good explain . I try to create a script in Perl to do a Telnet to Switch, i describe the step: after i type telnet 172.20.40.1, the switch show me a message: "Press Ctrl-Y to begin", after show a menu, donīt ask me for user or password because i disable that. In the menu i have to press "C" to enter "Command Line Mode" and then write all commands to configurate the switch; next i have to type exit and will back to menu, next press "l" to logout of telnet. OK? All this i try to do a script unattended. Itīs possible? Well,i probe the "sub ctrl" but if any other sugestion will welcome, Thanks a lot. (sorry for my english)

In reply to Re^2: Net:Telnet to Nortel Switch by dperdomo
in thread Net:Telnet to Nortel Switch by dperdomo

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.