Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Using Net::SSH2 with Net::Telnet::Cisco

by Argel (Prior)
on Jan 15, 2011 at 00:21 UTC ( [id://882428]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using Net::SSH2 with Net::Telnet::Cisco
in thread Using Net::SSH2 with Net::Telnet::Cisco

As you can see from the docs below, "use" statements are processed before regular code. So I doubt putting them in the subroutine will accomplish what you want.
use Module VERSION LIST use Module VERSION use Module LIST use Module use VERSION Imports some semantics into the current package from the named module, generally by aliasing certain subroutine or variable names into your package. It is exactly equivalent to BEGIN { require Module; import Module LIST; } except that Module must be a bareword.
In 882270 tilly suggested:
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.
Have you tried ditching "use" and go with "require" like he suggested? Seems like the next course of action to take.

Elda Taluta; Sarks Sark; Ark Arks

Replies are listed 'Best First'.
Re^4: Using Net::SSH2 with Net::Telnet::Cisco
by ryber (Acolyte) on Jan 18, 2011 at 18:12 UTC

    Thanks for your response, Argel. Yes, that did occur to me and I tried changing the "use" statements to require, but it did not make a difference. Both Net::Appliance::Session and Net::SSH::Perl still fail in the same way.

    I am now looking at trying to use Net::Telnet::Cisco on top of Net::SSH2. What I would like to do is create an SSH connection and pass an open filehandle to Net::Telnet. However, Net::SSH2 creates only a PERL filehandle, and Net::Telnet wants a filehandle implemented at the C level (or so is my understanding).

    Any thoughts on how I might be able to swing that? I was thinking I might be able to open a file on the underlying Unix system to which I could somehow pipe the PERL handle I got back from Net::SSH2

    Thanks, Ryan

      That's really pushing my expertise. However, one thing I can do to help is to FrontPage your question. Hopefully that will get some qualified eyes on it.

      Elda Taluta; Sarks Sark; Ark Arks

        Thanks, Argel. I am happy for any help I may be able to get.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://882428]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-29 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found