use strict; use warnings; use Config; print "1: $Config{optimize}\n"; my $preferred = tied %Config; $preferred->{optimize} = 'this is what I want'; print "2: $Config{optimize}\n"; __END__ On my Windows 7 box, that outputs: 1: -s -O2 2: this is what I want