Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Run Remote Command Via SSH

by Sandy (Curate)
on Nov 06, 2012 at 00:44 UTC ( #1002406=note: print w/replies, xml ) Need Help??


in reply to Run Remote Command Via SSH

Hi, sorry, I know nothing about Net::SSH.

However, when you "use" with a list, it is only subs within that list that are immediately available.

Try

use Net::SSH qw(ssh_cmd ssh ...)

Good luck!

Replies are listed 'Best First'.
Re^2: Run Remote Command Via SSH
by Lotus1 (Curate) on Nov 06, 2012 at 03:42 UTC

    I just sent an email to the module authors since the code posted by the OP is almost straight out of the synopsis for Net::SSH. The example code also does not import ssh_cmd. It's minor but can be confusing for someone new to Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002406]
help
Chatterbox?
[Lady_Aleena]: Renaming things like get_THAC0 to just THAC0 was easy. These are harder.
[james28909]: consolidate the three subs into one
[Lady_Aleena]: Um, what?
[james28909]: check is is data or hash or array and do tasks then return needed data
[Lady_Aleena]: james28909, you might want to look at the other two on my scratchpad.
[james28909]: after you send to a sub, you can check if it is array or ref ect with ref

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-05-24 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?