Not sure that this applies to what you want to do:
use warnings;
use strict;
use Config;
my $obj = tied %Config::Config;
print $Config::Config{startperl}, "\n";
$obj->{startperl} = "garbage";
print $Config::Config{startperl}, "\n";
__END__
outputs:
#!perl
garbage
That's a technique used by ExtUtils::FakeConfig. If you want a hard coded Config.pm with altered values it might be safer to use ExtUtils::FakeConfig. It creates a Config_m.pm with the overwritten Config values. If you want to use those overwritten values, you invoke perl with '-MConfig_m'. Otherwise the original Config values are used. ExtUtils::FakeConfig was written with a view to overwriting some
specific Config values, but I think it can fairly easily be generalised. Could be worth a look.
Cheers,
Rob