NET::TELNET and displaying output on-screen

From: ZoloftGuy (zoloftguy_at_myrealbox.com)
Date: 08/06/04


Date: 6 Aug 2004 12:40:01 -0700

I'm a newbie to Perl and I am writing a script to telnet in an shut
off one of our Nortel Contivity VPNs. It works but, I'd like some of
the activity to display on the screen rather then just in the logs.

Is there anyway to do this? Here is the script. Please tell me if
there is anything back-asswords about it. Thanks:

$t = new Net::Telnet (Timeout => 30, Prompt => '/[\$]/');

# Contivity
system "cls"; #This clears the screen.
print "Ok, First, lets shut down the Contivities\n";
$t->open("contivity");
$t->waitfor('/Login:/');
$t->print("admin");
$t->waitfor('/Password:/');
$t->print("pass");
$t->waitfor('/CES\>/');
$t->print("en");
$t->waitfor('/Password:/');
$t->print("pass");
$t->print("shutdown -h");
$t->errmode(sub {die @_ unless $_[0] =~ /eof/});
@output1 = $t->cmd('y');
print @output1;
$t->close;



Relevant Pages

  • Re: NET::TELNET and displaying output on-screen
    ... >I'm a newbie to Perl and I am writing a script to telnet in an shut ... >off one of our Nortel Contivity VPNs. ... Here is the script. ...
    (comp.lang.perl.misc)
  • Re: [WR] round tuits
    ... Jackson Pillock wrote: ... I do, too many projects going, not enough time, priorities lean toward ... I started writing a precinct drama set in a locked psychiatric ward. ... Sent off my script. ...
    (misc.writing)
  • Re: crisis Perl
    ... As to writing good code to begin with, ... the top of the script. ... the "use warnings;" line won't actually change ... recommended declaring variables IN AS SMALL AS SCOPE AS POSSIBLE. ...
    (comp.lang.perl.misc)
  • Marginally archaeaology: Eight scripts that still cant be read
    ... WRITING is one of the greatest inventions in human history. ... literate civilisation at the time of the ... So how do you decipher an unknown script? ... there must be some link to a known language. ...
    (sci.archaeology)
  • Re: Vinca script, cross bar angle - Ki Ri Ke
    ... of the Goddess, since the English title of the second book ... sacred script in The Goddesses and Gods of Old Europe, ... not exactly a scholarly publisher. ... writing scholars call "ideograms," and hence not as writing. ...
    (sci.lang)

Loading