The FILENO issue that you are encountering is because Net::Telnet is trying to get a fileno that it can hand to C code which doesn't understand Perl filehandles. But it is implemented in Perl so there is no such fileno, and therefore no FILENO method implemented, and therefore you have a problem. That's a non-starter.

The first option is to stop using threads. This is not as crazy as it sounds. Try replacing threads with forks, and see if it works. If it does, then your thread problems may go away. If they don't go away, then be careful to require the module from within the same "thread" as you instantiate the object and they definitely should go away.

Another option is to create a standalone process that uses Net::Appliance::Session and Net::SSH::Perl which can be driven from within a thread in your main application. Be warned that this type of network programming usually takes more work than you were planning on.

The third option I see is to try to debug the thread problems in the original modules. I have no idea how easy or hard that will be. If you're lucky it will be as simple as not using the modules, but instead require them in the thread that you instantiate the objects from.


In reply to Re: Using Net::SSH2 with Net::Telnet::Cisco by tilly
in thread Using Net::SSH2 with Net::Telnet::Cisco by ryber

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.