bliako has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I would like to know if there is already a Perl module which provides a network server for serving Perl modules from a remote location and a directive to be embeded in a perl script so as to load said modules from the server. Preferably using encryption.
For example,
use Module::X from 192.32.43.45:7777 ssh='.ssh/id_rsa';
thanks, bliako
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Loading modules remotely
by Corion (Patriarch) on Jul 20, 2018 at 12:32 UTC | |
Also see lazy (and its references) for an example implementation. These will not do ssh transport and do expect modules to conform to the CPAN standard, but maybe that isn't all bad. | [reply] [d/l] |
Re: Loading modules remotely
by QM (Parson) on Jul 20, 2018 at 10:02 UTC | |
This node might help. There are other solutions which suggest pulling a module over from the remote host. And others how to use a module without installing it (under some conditions). -QM | [reply] |
by bliako (Monsignor) on Jul 20, 2018 at 10:16 UTC | |
that node has a lot of references thanks | [reply] |
Re: Loading modules remotely
by marto (Cardinal) on Jul 20, 2018 at 10:07 UTC | |
I've mentioned this a few times (for example), as the URL is not currently accessible check the way back machine archive. The Frankfurt slides detail 'Application repositories' which sounds like what you want to achieve. | [reply] |
Re: Loading modules remotely
by LanX (Saint) on Jul 20, 2018 at 09:59 UTC | |
Especially with XS? I can see how to implement this for the simplest case*, but this tastes like an XY Problem... ... I'm reluctant to search CPAN for you before the question is clearer. Most probably you just need PAR::Packer
Cheers Rolf
*) by hooking into %INC | [reply] |
by bliako (Monsignor) on Jul 20, 2018 at 10:21 UTC | |
yes XS poses a problem, though it can be solved with PAR from a binary-compatible server. Hooking into %INC is by far the simplest for my purposes (no XS, can be loaded into memory without intermediary files) | [reply] |
Re: Loading modules remotely
by tobyink (Canon) on Jul 20, 2018 at 12:58 UTC | |
Personally, I'd just use stuff we know already works. Modules are just files. There are already solutions for accessing files on a remote system. Using things like SAMBA and sshfs, it is possible to mount remote directories as if they were part of the local file system. Then just add the right path to @INC. | [reply] [d/l] |
by bliako (Monsignor) on Jul 20, 2018 at 20:47 UTC | |
Yep, at the beginning it sounded like a lot. But after all the comments, it just amounts to running the script, load LWP module, transfer the module archives, possibly encrypted, from a remote server (public or private), extract/unencrypt the content and load within same script without even writing anything to local disk, which is what I wanted to do. I hope it will work as it is just a sketch as of this evening. I wouldn't call it an X-Y problem but may be it has another name like the C-B-A problem. thanks, bliako | [reply] |
by clueless newbie (Curate) on Jul 21, 2018 at 01:01 UTC | |
This loads module source from a database.
| [reply] [d/l] |
by bliako (Monsignor) on Jul 21, 2018 at 08:12 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |