++ed by:
18 non-PAUSE users
Author image brian d foy

The build file for PerlPowerTools

This build file is a modulino; it works as both a build script and a module.

To build the distribution, run this file normally:

        % perl Makefile.PL

If you didn't specify INSTALL_BASE, the modules go into your home directory under perlpowertools. You'll need to add this to PATH to be able to use them.

If you want to install them somewhere else, run the Makefile.PL with your installation location:

    % perl Makefile.PL INSTALL_BASE=/where/you/want/them/to/go

But, this Makefile.PL is more interesting than that. You can load it with require and call arguments to get the data structure it passes to WriteMakefile:

        my $package = require '/path/to/Makefile.PL';
        my $arguments = $package->arguments;

Note that require-ing a file makes an entry in %INC for exactly that name. If you try to require another file with the same name, even from a different path, require thinks it has already loaded the file. As such, I recommend you always require the full path to the file.

The return value of the require is a package name (in this case, the name of the main module). Use that to call the arguments method.

Even if this distribution needs a higher version of Perl, this bit only needs v5.8. You can play with the data structure with a primitive Perl.