Help for this page

Select Code to Download


  1. or download this
    package Tie::HashDefaultValue;
    require Tie::Hash;
    ...
    }
    
    1;
    
  2. or download this
    tie my %bar, 'Tie::HashDefaultValue', sub {};
    # time passes
    $bar{foo}->();
    
  3. or download this
    sub FETCH { exists $_[0][0]{$_[1]} ? $_[0][0]{$_[1]} : $_[0][1] }