Given this, I do not understand your question. Why do you think that you are still not logged in? If this is the end of the script, then of course you will no longer be logged in. The telnet session is within the context of the perl script. Once the perl script ends, the telnet session goes away.#!/usr/bin/perl use Net::Telnet::Cisco ; my $switch = $ARGV[0] ; print "$switch \n" ; my $session = Net::Telnet::Cisco->new(Host => 'ba1-1'); $session->login('charlie', 'letmein'); if ($session->enable("letmein") ){ @output = $session->cmd('show privilege'); print "My privileges: @output\n"; } else { warn "Can't enable: " . $session->errmsg; }
If there is more to the script that you have not provided that seems to indicate that the login has terminated, I/we need to see it.
In reply to Re: Telnet to Cisco command prompt...
by Illuminatus
in thread Telnet to Cisco command prompt...
by WearyTraveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |