- or download this
# Using "tie".
...
untie(%data); # Free mem. %data going out of scope is not enough.
}
- or download this
# Using objects.
...
$data->{'Entries'}{'Flowers'}{'Rose' }{'Colour'}, $/, # red
$data->{'Entries'}{'Flowers'}{'Dahlia'}{'Colour'}, $/; # blue
}
- or download this
package Tie::Hash::Inheriting;
...
sub DELETE { delete $_[0][0]->{$_[1]} }
sub CLEAR { %{$_[0][0]} = () }
sub SCALAR { scalar %{$_[0][0]} }
- or download this
use Tie::Hash::Inheriting ();
...
my ($self) = @_;
untie(%$self);
}