Module::Install::Can(3pm)

Module::Install::Can3pm

Utility functions for capability detection

Overview

"Module::Install::Can" contains a number of functions for authors to use when creating customised smarter installers. The functions simplify standard tests so that you can express your dependencies and conditions much more simply, and make your installer much easier to maintain.

Commands

can_use

  can_use('Module::Name');
  can_use('Module::Name', 1.23);

The "can_use" function tests the ability to load a specific named module. Currently it will also actually load the module in the process, although this may change in the future.

Takes an optional second param of a version number. The currently installed version of the module will be tested to make sure it is equal to or greater than the specified version.

Returns true if the module can be loaded, or false (in both scalar or list context) if not.

can_run

  can_run('cvs');

The "can_run" function tests the ability to run a named command or program on the local system.

Returns true if so, or false (both in scalar and list context) if not.

can_cc

  can_cc();

The "can_cc" function tests the ability to locate a functioning C compiler on the local system. Returns true if the C compiler can be found, or false (both in scalar and list context) if not.

can_xs

  can_xs();

The "can_xs" function tests for a functioning C compiler and the correct headers to build XS modules against the current instance of Perl.

To do

Currently, the use of a "can_foo" command in a single problem domain (for example "can_use") results in the inclusion of additional functionality from different problem domains (for example "can_run").

This module should ultimately be broken up, and the individual functions redistributed to different domain-specific extensions.

Releases

11 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10–11
  8. 12
  9. 13
  10. Arch

Authors

Audrey Tang <[email protected]>

Adam Kennedy <[email protected]>

From perl-module-install 1.21-6 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.