tie our %conf, 'My::Hash'; # $dir is a tied Tie::Scalar our $dir = $conf{'dir'}; print $dir, $/; # prints /home/foo for example # using tie magic, storing a value in $dir also updates # 'dir' in %conf $dir = '/somewhere/else'; $dir = $conf{'dir'}; print $dir, $/; # now prints /somewhere/else