+my $osname = fetch_string({}, 'osname');
+my $from = $osname eq 'VMS' ? 'PERLSHR image' : 'binary (from libperl)';
+my $env_cygwin = $osname eq 'cygwin'
+ ? 'push @env, "CYGWIN=\"$ENV{CYGWIN}\"" if $ENV{CYGWIN};' . "\n" : "";
+
+$heavy_txt .= sprintf <<'ENDOFBEG', $osname, $osname, $from, $osname, $env_cygwin;
+# This file was created by configpm when Perl was built. Any changes
+# made to this file will be lost the next time perl is built.
+
+package Config;
+use strict;
+use warnings;
+our %%Config;
+
+sub bincompat_options {
+ return split ' ', (Internals::V())[0];
+}
+
+sub non_bincompat_options {
+ return split ' ', (Internals::V())[1];
+}
+
+sub compile_date {
+ return (Internals::V())[2]
+}
+
+sub local_patches {
+ my (undef, undef, undef, @patches) = Internals::V();
+ return @patches;
+}
+
+sub _V {
+ die "Perl lib was built for '%s' but is being run on '$^O'"
+ unless "%s" eq $^O;
+
+ my ($bincompat, $non_bincompat, $date, @patches) = Internals::V();
+
+ my @opts = sort split ' ', "$bincompat $non_bincompat";
+
+ print Config::myconfig();
+ print "\nCharacteristics of this %s: \n";
+
+ print " Compile-time options:\n";
+ print " $_\n" for @opts;
+
+ if (@patches) {
+ print " Locally applied patches:\n";
+ print " $_\n" foreach @patches;
+ }
+
+ print " Built under %s\n";
+
+ print " $date\n" if defined $date;
+
+ my @env = map { "$_=\"$ENV{$_}\"" } sort grep {/^PERL/} keys %%ENV;
+%s
+ if (@env) {
+ print " \%%ENV:\n";
+ print " $_\n" foreach @env;
+ }
+ print " \@INC:\n";
+ print " $_\n" foreach @INC;
+}
+
+sub header_files {
+ENDOFBEG
+
+$heavy_txt .= $header_files . "\n}\n\n";
+