Capability — test existence of a capability
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
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
Interchange 5.9.0:
Source: lib/Vend/Config.pm
Line 2588 (context shows lines 2588-2590)
sub parse_capability {
return parse_require(@_, 1, 1);
}