Wilson Snyder


Module::LocalBuild - Support routines for setting up perltools area


        ( dest_dir => "obj_foobar",
          # Areas we don't need to build, but need to add libraries for
          libs => ["some_path/ModuleFoo/lib",
          # Packages we need to build
          # It is important to include Module-LocalBuild in its own list
          # otherwise changes in the build process won't be detected as changes!
          packages => ['some_path/Module-LocalBuild',
          # Additional build dependencies
          deps => [],


Module::LocalBuild is used to call 'perl Makefile.PL' and friends on packages in a local working copy of a source code repository. This allows people to have local copies of Perl modules, and edit them at will without having to worry about when to compile them.

It also allows the same sources to be simultaneously built and maintained under different operating systems.



Specify needed submodules. Checks the specified modules's date stamps, and if needed run make on them, and install them into a local directory.

Setup the 'use lib' and PERL5LIB path appropriately to find the modules, and so any programs called under a new shell (with the same environment) will also find them.

Requires named parameters as specified below.

dest_dir => directory

Directory name to write the blib library tree under. This directory should be absolute, and should include the Perl version number; otherwise builds on different OSes may collide.

deps => [ directories... ]

Additional directory names which if change will request a rebuild. This is useful for local files, such as scripts which wrap mlbuilder.

libs => [ directories... ]

Add the specified perl library directories, as if using 'use lib'. However, in addition to doing a 'use lib' they will be added to PERL5LIB such that subprocesses may see the libraries specified.

locker_module => package_name

If specified, when a rebuild is required this package will be used for lock services. This prevent multiple processes from building at once, even when run under NFS on different machines. IPC::Locker is compatible with the API required.

packages => [ packages... ]

List of packages. Future versions will support an array of hash references, where each hash may specify an action associated with the package.



This environment variable is set automatically when the packages are built. When set calling Module::LocalBuild will skip the build process. This accelerates subprocesses, as only the parent process needs to complete the up-to-date check.


The requested libraries are appended to the standard Perl PERL5LIB variable.


Copyright 2000-2010 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.


Wilson Snyder <wsnyder@wsnyder.org>


mlbuilder, IPC::Locker