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 | [reply] [Watch: Dir/Any] [d/l] |
That was exactly what I needed. Thanks!
| [reply] [Watch: Dir/Any] |
... And if you want to see *all* of the values in the Config hash in a nicely formatted HTML page:
use HTML::Perlinfo;
perlinfo(INFO_CONFIG);
| [reply] [Watch: Dir/Any] [d/l] |
| [reply] [Watch: Dir/Any] |
I know. I'm certainly not planning to stick my hands in the defines etc., but I may want to change installation paths to relocate an installation.
| [reply] [Watch: Dir/Any] |