The below script works fine for me but with normal login, Actually i need to go with "enable 5" and with password "xxxx" to get the user details. So please any one help is here highly appreciated.

I am using Net::Telnet::Cisco

Here is my prompt for enable, Pleaes have look on it,

ERX02>enable 5 Password: ********** ERX02#
#!/usr/bin/perl use Net::Telnet::Cisco; #$rtrip = 'xx.xx.xx.xxx'; #$pass='support123'; sub juniperlogin { $rtrip = $_[0]; print "Logging into router $rtrip\n"; $session = Net::Telnet::Cisco->new(Host => $rtrip, Timeout => '30'); $session->login(Name => 'login', Password => 'support123', Prompt => ' +/ERX02>$/', Timeout => '30'); #$session->cmd(String => "set cli screen-length 0", Prompt => '/(?m:^\ +w+@[\w.-]+[>])/', Timeout => '30'); } sub junipercmd { $cmd = $_[0]; #@output = $session->cmd(String => "$cmd", Prompt => '/(?m:^\w+@[\w.-] ++[>])/', Timeout => '60'); @output = $session->cmd(String => "$cmd", Prompt => '/ERX02>$/', Timeo +ut => '60'); return @output; } &juniperlogin("1.1.7.1"); @output =&junipercmd("show version"); print @output;

In reply to help needed by Mejaz

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.