Probably good news, spivey49. Your program starts to die when Net::Telnet::Netscreen restores the settings of Net::Telnet before calling Telnet::error() in &scrolling_cmd. By default, Net::Telnet dies on error. So this is not really a bug in Net::Telnet::Netscreen, just behaviour inherited from Net::Telnet. When something goes wrong your program dies. You can see that by setting $SIG{__DIE__}.

You may continue with one of the two (there are more, see Net::Telnet) alternatives:

... # w/o ALT1,2 - try: $SIG{__DIE__} = sub { warn "\nDIIIII\n", caller }; $fw = new Net::Telnet::Netscreen( host => $host ); # ALT1: Ignore (bad idea, but quick debugging fix): # $fw->errmode("return"); # ALT2: Analyse problem yourself / decide to abort or to continue: # $fw->errmode( sub { warn "ERRHANDLER: @_\n"; } ); ...

Since I don't own a Netscreen FW, I simulated it manually with netcat. Here is what your program does (it misses a 'save'?):

login:
netscreen
password:
netscreen
set address Untrust AutoGenRule_1.1.0.1 1.1.0.1/32 "Created with perl for testing"
set policy id 150 from Untrust to Trust AutoGenRule_1.1.0.1 any any perm log
set address Untrust AutoGenRule_1.1.0.2 1.1.0.2/32 "Created with perl for testing"
set policy id 150 from Untrust to Trust AutoGenRule_1.1.0.2 any any perm log
Being not a well trained Netscreen FW, I didn't respond to the commands. Consequently, a timeout occurred, which was ignored due to reconfiguring the error-behaviour to "return". You might experience other errors, but your program won't die in the middle of somewhere. One small step forward...


In reply to Re: Broken Net::Telnet::Netscreen module? by Perlbotics
in thread Broken Net::Telnet::Netscreen module? by spivey49

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.