in reply to weird reference bug with perl 5.005_03

I don't know how much liberty you have to change the code, but this modification seems like it would make life a thousand times simpler and is certainly less obfuscated. Instead of "ctitle" you could pass a reference to any structure and it will correctly reference it. It is not quite as strict in parsing the key names but that would be simple to add.
#!/usr/bin/perl $CONFIGS={}; string_to_struct("CONFIGS-hosting_plans-c-title","ctitle"); print $CONFIGS->{hosting_plans}{c}{title}; exit; sub string_to_struct { my $string = shift; my $val = shift; my ($var, $keys) = split /-/, $string, 2; # safety check would normally be here - removed for simplicity no strict refs; my $ref = $$var; use strict refs; my $pointer = $ref; my @a = split(/-/,$keys); foreach ( 0..$#a ){ $pointer->{$a[$_]} = ($_ == $#a) ? $val : {}; $pointer = $pointer->{$a[$_]}; } $ref; }