2

I am developing a simple tool that will be used across a variety of platforms (mostly Solaris, Linux and HP-UX). The tool relies on the module Proc::ProcessTable however I would like to avoid having to build/install the module across all the systems it will be used on.

Rather, I would like to 'embed' the Proc::ProcessTable code inside my tool. The result I am seeking is to have a single file that will work in all systems, without having to install the module separately.

Is this possible at all? Embedding a Perl-only module would be trivial, but this module compiles some OS-specific C code. Assuming I could compile that code on each of the OS I need, how would I go about including that pre-compiled C code inside my Perl script in order to make the embedded module work?

emx
  • 1,295
  • 4
  • 17
  • 28
  • Well, one way or another, your tool will need to know where the module is. So, you can either install the module as normal or add the path to the module file to `@INC`. –  Jun 17 '12 at 10:39
  • Perhaps the forthcoming [`Remote::Object`](http://www.youtube.com/watch?v=Qze6a7gydeg&list=PLE3F888A650339DDF&index=46&feature=plpp_video) would help :-) – Joel Berger Jun 17 '12 at 15:26
  • This presentation was such a laugh... very interesting! – emx Jun 18 '12 at 03:02

1 Answers1

1

I would like to avoid having to build/install the module across all the systems it will be used on

Set up a local build system/farm, and produce packages (e.g. RPM) for the target operating systems. One prerequisite is that you turn your tool into a CPAN-ready distribution, and mark Proc::ProcessTable as a run-time dependency.

Community
  • 1
  • 1
daxim
  • 39,270
  • 4
  • 65
  • 132
  • Thanks for outlining so clearly the steps involved. This definitely points me in the right direction, very helpful answer. And this [YAPC](http://act.yapc.eu/ye2012/) event seems to be a lot of fun. – emx Jun 18 '12 at 03:12