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

Re^3: Run a subroutine through ssh? (Net::SSH::Perl)

by roden (Novice)
on Oct 31, 2011 at 15:15 UTC ( #934903=note: print w/replies, xml ) Need Help??

in reply to Re^2: Run a subroutine through ssh? (Net::SSH::Perl)
in thread Run a subroutine through ssh? (Net::SSH::Perl)

I should note that I thought of using local::lib to keep modules private and without needing root access, but I'm pretty wary of tampering with the test environment in any way. The ideal situation is to have a persistent ssh session (persistent even when calling a subroutine) which I can tell it to close when I want:

1) open ssh session
2) call subroutine (subroutine should run within the ssh session, not on the local system)
3) close ssh session
I will be indebted to anyone who has done this or can point me in a good direction.

  • Comment on Re^3: Run a subroutine through ssh? (Net::SSH::Perl)

Replies are listed 'Best First'.
Re^4: Run a subroutine through ssh? (Net::SSH::Perl)
by johnny_carlos (Scribe) on Oct 31, 2011 at 23:09 UTC
    I'm no expert, but it doesn't sound possible to me. Here's another idea though. What if on the test boxes you write a CGI program that outputs the data in some format, such as CSV or XML. Then the other machine uses LWP to retrieve the data and run it through the subroutines? You could use IO::Socket if you really wanted to get fancy, but conceptually it's the same thing. That is, you are retrieving the data from one box, parsing it on another.
Re^4: Run a subroutine through ssh? (Net::SSH::Perl)
by aaron_baugher (Curate) on Nov 23, 2011 at 21:58 UTC

    You're hoping to run some code (whether you call it a 'subroutine' or not doesn't matter) on a remote system, but have it call other code (modules) back on the local system somehow. I don't think that's possible, short of mounting the local system on the remote via NFS or something, which would be a lot sketchier than the reasonable options you're saying wouldn't be allowed.

    Using local::lib seems like the most sensible solution, assuming you can't get the server admins to install the modules for you.

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://934903]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2018-07-16 22:46 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (352 votes). Check out past polls.