Name

Capability — test existence of a capability

SYNOPSIS

type type-specific-value ...

DESCRIPTION

Just like Require or Suggest, this directive checks for a capability, but unlike the first two it never causes a warning or other message. This allows a module to be loaded if available and a program can later check for the capability and dynamically adapt to the configuration.

"Capabilities" you can check for are:

  • globalsub — existence of a GlobalSub

  • sub — existence of a Sub

  • taggroup — existence of a TagGroup

  • usertag — existence of a UserTag

  • module (or perlmodule) — existence of a Perl module

  • include (or perlinclude) — prepend specified path to Perl's @INC include path (makes most sense with Require, not with Suggest or Capability even though it can be called that way for equivalent effect)

  • file — existence of a readable file

  • executable — existence of an executable file

DIRECTIVE TYPE AND DEFAULT VALUE

Global directive

EXAMPLES

Example: Testing for existence of all supported items

Capability globalsub my_global_sub
Capability sub my_sub
Capability taggroup :group1,:group2 :group3
Capability usertag my_global_usertag
Capability usertag my_catalog_usertag
Capability module Archive::Zip
Capability module Set::Crontab /usr/local/perl/modules/
Capability file /etc/syslog.conf
Capability file relative-dir/file
Capability executable /usr/local/bin/gfont
Capability executable bin/gfont

Example: Testing for existence of old-style Perl module

Capability module /path/to/module.pl

NOTES

AVAILABILITY

Capability is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 400

['Capability',     'capability',     ''],

Source: lib/Vend/Config.pm
Line 2583 (context shows lines 2583-2585)

sub parse_capability {
return parse_require(@_, 1, 1);
}

AUTHORS

Interchange Development Group

SEE ALSO

Suggest(7ic), Require(7ic)

DocBook! Interchange!