This function will collect the data described in "the hash structure" below, and return that as a hash reference. It optionally accepts an option to include more entries from %ENV. See environment below.

Note that this will not work on uninstalled perls when called with -I/path/to/uninstalled/perl/lib, but it works when that path is in $PERL5LIB or in $PERL5OPT, as paths passed using -I are not known when the -V information is collected.

As some variables are reported by a different name in the output of perl -V than their actual name in %Config, I decided to leave the config entry as close to reality as possible, and put in the entries that might have been guessed by the printed output in a separate block.

This module was written to be able to 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.