Exit Telnet session

Discussion in 'Perl Misc' started by chandrasekhar.karanam@gmail.com, Mar 7, 2007.

  1. Guest

    Hi,

    I wrote a perl file to telnet to Windows host using Net::Telnet.
    Once I telnet to remote host I execute a perl script.
    I am facing the problem with timeout, If I give default time out the
    script fails to execute within the time, if I give more time out then
    perl script executes but still it will not close the telnet session
    until the time out reaches.

    Below is the script
    my $tel_obj = new Net::Telnet (errmode => 'return', Binmode =>0);
    $tel_obj->buffer_empty;
    $tel_obj->input_log($LOG_FILE);
    if(!($tel_obj->open($ARGV[1]))) {
    print "Unable to telnet...\n";
    return 0;
    }
    $tel_obj->login(Name => $ARGV[2],
    Password => $ARGV[3]);
    $tel_obj->cmd(String => "cd $SOURCE_PATH");
    my $sec = $tel_obj->timeout(99);
    print $sec;
    my $cmd_str = "perl $ARGV[4]";
    $tel_obj->buffer_empty;
    $tel_obj->cmd($cmd_str);
    $tel_obj->close;

    Please help me in solving this issue.
     
    , Mar 7, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    7,963
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  2. Joe Smith
    Replies:
    4
    Views:
    66,053
    sandeep1976
    Nov 8, 2006
  3. Replies:
    2
    Views:
    479
    Jeff Epler
    May 31, 2005
  4. Jim Isaacson
    Replies:
    5
    Views:
    623
    Default User
    Nov 5, 2004
  5. Carcarius
    Replies:
    0
    Views:
    322
    Carcarius
    Dec 6, 2007
Loading...

Share This Page