1 package Config::Extensions;
3 use vars qw(%Extensions $VERSION @ISA @EXPORT_OK);
9 @EXPORT_OK = '%Extensions';
11 foreach my $type (qw(static dynamic nonxs)) {
12 foreach (split /\s+/, $Config{$type . '_ext'}) {
14 $Extensions{$_} = $type;
22 Config::Extensions - hash lookup of which core extensions were built.
26 use Config::Extensions '%Extensions';
27 if ($Extensions{PerlIO::via}) {
28 # This perl has PerlIO::via built
33 The Config::Extensions module provides a hash C<%Extensions> containing all
34 the core extensions that were enabled for this perl. The hash is keyed by
35 extension name, with each entry having one of 3 possible values:
41 The extension is dynamically linked
45 The extension is pure perl, so doesn't need linking to the perl executable
49 The extension is statically linked to the perl binary
53 As all values evaluate to true, a simple C<if> test is good enough to determine
54 whether an extension is present.
56 All the data uses to generate the C<%Extensions> hash is already present in
57 the C<Config> module, but not in such a convenient format to quickly reference.
61 Nicholas Clark <nick@ccl4.org>