Config::Perl::V(3perl)
π Config::Perl::V β the perl -V decoder ring π
okay bestie, welcome to Config::Perl::V(3perl), part of the Perl Programmers Reference Guide π«Ά this is the module that takes the messy text blob that perl -V spits out and turns it into structured data you can actually poke at. main character energy fr fr β¨
πΈ SYNOPSIS πΈ
use Config::Perl::V;
my $local_config = Config::Perl::V::myconfig ();
print $local_config->{config}{osname};
like. look at that. two lines and you're already vibing π
π¦ DESCRIPTION π¦
π $conf = myconfig ()
This one goes and collects all the data described down in "The hash structure" below, then hands it back to you as a hash reference. It optionally accepts an option so you can pull in more entries from %ENV β peep "environment" below for the tea.
β οΈ no cap: this will not work on uninstalled perls when you call it with-I/path/to/uninstalled/perl/lib. The way that it does work is when that path lives in$PERL5LIBor in$PERL5OPT, because paths handed over with-Iare literally not known at the moment the-Vinfo gets collected. tragic but true π
π $conf = plv2hash ($text [, ...])
Converts one single perl -V text block β or a list of lines β into a full-on complete myconfig hash. Every unknown entry gets defaulted. no loose ends, we love that for us β¨
π $info = summary ([$conf])
Returns an arbitrary selection of the information. And if you don't hand it a $conf? Then myconfig () gets used instead. it just fills in for you, so sweet π
π $md5 = signature ([$conf])
Returns the MD5 of the info that summary () gives back, minus the config_args entry. bye girl π
And if Digest::MD5 isn't available? It returns a string made of only 0's. not ideal but it's honest π
π₯ The hash structure π₯
The returned hash is made of 4 parts, and every single one matters:
β¨ build
This info gets extracted from the second block that perl -V emits, and usually it looks a lil something like this:
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
Locally applied patches:
defined-or
MAINT24637
Built under linux
Compiled at Jun 13 2005 10:44:20
@INC:
/usr/lib/perl5/5.8.7/i686-linux-64int
/usr/lib/perl5/5.8.7
/usr/lib/perl5/site_perl/5.8.7/i686-linux-64int
/usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl
.
or alternatively:
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING MULTIPLICITY
PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL
PERL_USE_SAFE_PUTENV USE_ITHREADS
USE_LARGE_FILES USE_PERLIO
USE_REENTRANT_API
Built under linux
Compiled at Jan 28 2009 15:26:59
This info is not available anywhere else, not even in %Config β this is the tea that only the perl binary itself knows. iykyk π₯
The extracted info lives in 5 entries inside the build hash:
osnameβ most likely identical to$Config{osname}, and it was the name that was known back when perl was built. It can differ if perl got cross-compiled. The default for this field, if it can't be extracted, is to copy$Config{osname}. And the two might disagree on casing (OpenBSDvsopenbsd) β lowercase girlies vs uppercase girlies, we don't judge πstampβ the time string for when the perl binary was compiled. Default value is0.optionsβ a hash with all the known defines as its keys. The value is either0, which means unknown or unset, or1, which means defined. binary codec behavior honestly πderivedβ since some variables get reported under a different name in the output ofperl -Vthan their actual name in%Config, the author decided to keep theconfigentry as close to reality as possible, and stash the entries that might have been guessed from the printed output into a separate block. separate but equal, iconic πpatchesβ a list of optionally locally applied patches. Default is an empty list.
β¨ environment
By default this hash only gets filled with the environment variables out of %ENV that start with "PERL". But bestie, you can pass the "env" option to myconfig to get more:
my $conf = Config::Perl::V::myconfig ({ env => qr/^ORACLE/ });
my $conf = Config::Perl::V::myconfig ([ env => qr/^ORACLE/ ]);
β¨ config
This hash gets filled with the variables that perl -V fills its report with, and it carries the same variables that Config::myconfig returns from %Config. matching sets, cute π«Ά
β¨ inc
This is the list of default @INC.
π REASONING π
This module was written so it could return the configuration for the currently used perl as deeply as needed for the CPANTESTERS framework. Up until now they used the output of myconfig as a single text blob, and so it was missing the vital binary characteristics of the running perl and the optional applied patches. glow-up achieved, periodt β¨
π BUGS π
Please feedback what is wrong. (literally. just tell us. we're nice, we promise π)
π TODO π
- Implement retrieval functions/methods
- Documentation
- Error checking
- Tests
(the list is giving "vision board" and honestly? we respect it πΈ)
π AUTHOR π
H.Merijn Brand <h.m.brand@xs4all.nl>
π COPYRIGHT AND LICENSE π
Copyright (C) 2009-2026 H.Merijn Brand
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page bestie, you ate it up π
one last thing: this page is from perl v5.44.0, dated 2026-10-17, and it's the Config::Perl::V(3perl) manual page itself. go read perl -V output without fear now, you got this π¦π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms