Data::StackedHash

Stack of PERL Hashes
Download

Data::StackedHash Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Riccardo Murri
  • Publisher web site:
  • http://search.cpan.org/~rmurri/

Data::StackedHash Tags


Data::StackedHash Description

Stack of PERL Hashes Data::StackedHash is a Perl module that implements a stack of hashes; the whole stack acts collectively and transparently as a single PERL hash, that is, you can perform the usual operations (fetching/storing values, keys, delete, etc.) on it. All the PERL buitlins which operate on hashes are supported.Assigning a value to a key, as in $h{'a'}=1, puts the key/value pair into the hash at the top of the stack. Reading a key off the stack of hashes searches the whole stack, from the topmost hash to the bottom one, until it finds a hash which holds some value associated to the given key; returns undef if no match was found.The built-in functions keys, values, each act on the whole collection of all key/value defined in any hash of the stack.You can add a hash on top of the stack by the method push, and remove the topmost hash by the method pop.Clearing a stack of hashes only clears the topmost one: that is, use Data::StackedHash; tie %h, Data::StackedHash, {'a'=>1}; # put some hash on top of the stack tied(%h)->push({'a'=>2}); print $h{'a'}; # prints 2 %h = {}; # clear topmost hash print $h{'a'}; # prints 1SYNOPSIS use Data::StackedHash; tie %h, Data::StackedHash; $h{'a'}=1; $h{'b'}=2; tied(%h)->push; # put a new hash on the stack $h{'a'}=3; # override value of key 'a' ... tied(%h)->pop; # remove top hash from the stack, # $h{'a'} == 1 again Requirements: · Perl


Data::StackedHash Related Software