Help for this page

Select Code to Download


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