Config#

📦 std

Look up the build-time configuration of the running Perl interpreter.

Config exposes the values recorded when Perl itself was compiled — platform, compiler flags, install paths, feature toggles. Scripts consult it to make portability decisions, locate installed libraries, or report interpreter characteristics.

Two surfaces are provided:

  • The tied hash %Config, accessed element-wise as $Config{key}. Lookup, existence, and iteration go through the tie hooks. The hash is read-only; STORE, DELETE, and CLEAR croak.

  • Programmatic queries: config_re, config_sh, config_vars, myconfig, compile_date, bincompat_options, non_bincompat_options, local_patches, header_files, and the perl -V backend _V.

Under pperl, every value reflects pperl’s own build, not any upstream perl’s. Callers using %Config entries to drive portability decisions (compiler name, archname, install prefix, feature defines) get answers that match the interpreter they are actually running.

Functions#

Hash access#

fetch#

Tied-hash read: return the value stored under a key.

exists#

Tied-hash membership test: does a key exist in %Config?

store#

Tied-hash write: always croaks; %Config is read-only.

delete#

Tied-hash delete: always croaks; %Config is read-only.

Synopsis

delete $Config{archname};    # dies

What you get back

Nothing. The call raises Config is read-only.

Differences from upstream

Fully compatible with upstream.

clear#

Tied-hash clear: always croaks; %Config is read-only.

Synopsis

%Config = ();                # dies

What you get back

Nothing. The call raises Config is read-only.

Differences from upstream

Fully compatible with upstream.

firstkey#

Tied-hash iterator: reset and return the first key.

nextkey#

Tied-hash iterator: return the next key after FIRSTKEY.

Querying#

myconfig#

Return a human-readable summary of the interpreter’s build.

config_sh#

Return the full configuration as one shell-assignment block.

config_vars#

Print selected configuration entries to STDOUT.

config_re#

Grep configuration entries whose key matches a pattern.

Introspection#

compile_date#

Return a one-line description of when and with what the interpreter was built.

local_patches#

Return the list of local patches applied to the interpreter.

bincompat_options#

Return the compile-time options that affect binary compatibility.

non_bincompat_options#

Return compile-time options that do not affect binary compatibility.

header_files#

Return the canonical list of Perl C header filenames.

_v#

Print the full perl -V report to STDOUT.