Hi,

I have a file with a few settings in, a hash of settings.

EG:

use strict;
use warnings;
our @EXPORT = qw($fileSize);

our $fileSize = { a=> {name => 'small', size => 50}, b=>{name=> 'medium',
size => 75,} c=>{name=> 'large', size => 100} };

These settings are used by several different programs and I don't always
want to apply all the settings. I thought I could do this:

# Make a local copy of HoH
my $ref = $fileSizes;

# remove a hash via key c
delete $ref->{'c'};

Print the original structure
print Dumper($fileSizes);

When I do this I get the reference without the C hash! I'm sure this is by
design, I'm sure there is a good reason for it but how keep a version
private?

Hope

Reply via email to