[Chicago-talk] Testing a module installation

Andrew Rodland arodland at comcast.net
Sat Jan 24 15:57:24 PST 2009

On Saturday 24 January 2009 05:45:04 pm Jay Strauss wrote:
> Hi,
> I've built a module, its on CPAN, Finance::InteractiveBrokers::TWS.
> I want to test that it installs properly from cpan and pulls down any
> required modules and works.
> I want to simulate a fresh install on a new host.  How does one go
> about this?  I have though maybe using a VM with a fresh OS install,
> but that seems like overkill, and I'm sure its unnecessary.
> What's the proper why to simulate a bare bones Perl installation?

Two answers: one slightly unixy, one very unixy.

1) Build a new perl with -Dprefix= and install it, then make sure to 
use /path/to/that/perl -MCPAN -e shell to install your module. That perl's 
compiled-in @INC will have paths under the prefix, so it won't see anything 
that you might have installed through your "system perl". However if you're 
doing any XS, it may well pull libraries from your system library path, so 
the test is a bit less than perfect.

2) Short of a fresh install in a VM, there's a fresh install in a chroot. I 
know that Debian, Redhat, and FreeBSD all have tools to make this quite 
simple, and I'm sure that other systems do as well. Debian's build procedures 
for their package repository actually work this way :)


More information about the Chicago-talk mailing list