Tie::HashHistory 0.03
Sponsored Links
Tie::HashHistory 0.03 Ranking & Summary
File size:
0.004 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
794
Date added:
2007-08-21
Publisher:
Mark-Jason Dominus, Plover Systems
Tie::HashHistory 0.03 description
Tie::HashHistory can track history of all changes to a tied hash.
SYNOPSIS
my $hh = tie %hash => Tie::HashHistory, PACKAGE, ARGS...;
@values = $hh->history(KEY);
Tie::HashHistory interposes itself between your program and another tied hash. Fetching and storing to the hash looks completely normal, but Tie::HashHistory is keeping a record of all the changes to the each key, and can Tie::HashHistory will give you a list of all the values the key has ever had, in chronological order.
The arguments to the tie call should be Tie::HashHistory, and then the arguments that you would have given to tie to tie the hash without the history feature. For example, suppose you wanted to store your hash data in an NDBM file named database. Normally, you would say:
tie %hash => NDBM_File, database, $flags, $mode;
to get this history feature, just add Tie::HashHistory before NDBM_File:
my $hh = tie %hash => Tie::HashHistory,
NDBM_File, database, $flags, $mode;
The data will still be stored in database, and it will still be an NDBM file. All the fetching and storing will look the same, but the change history of each key will be available.
The tie call will return an object; to find out the history of a key, use the history method on this object. It takes one argument, which is a key string. It will return a list of all the values that have ever been associated with the key, in chronological order, starting with the most recent. For example:
$hash{a} = first;
$hash{b} = second;
$hash{a} = third; # Overwrites old value
# Prints "third second" as you would expect
print "$hash{a} $hash{b}n";
@values = $hh->history(a);
# @values now contains (third, first)
@values = $hh->history(b);
# @values now contains (second)
At present, if called in scalar context, the history() method will return the number of items in the history. This behavior may change in future versions.
The underlying hash can be any tied hash class at all. To use a regular in-memory hash, use Tie::StdHash (distributed with Perl) as the underlying implementation:
use Tie::Hash; # *NOT Tie::StdHash*
my $hh = tie %hash => Tie::HashHistory, Tie::StdHash;
This is not as efficient as it could be because fetches and stores on %hash still go through two layers of tieing. I may fix this in a future release.
SYNOPSIS
my $hh = tie %hash => Tie::HashHistory, PACKAGE, ARGS...;
@values = $hh->history(KEY);
Tie::HashHistory interposes itself between your program and another tied hash. Fetching and storing to the hash looks completely normal, but Tie::HashHistory is keeping a record of all the changes to the each key, and can Tie::HashHistory will give you a list of all the values the key has ever had, in chronological order.
The arguments to the tie call should be Tie::HashHistory, and then the arguments that you would have given to tie to tie the hash without the history feature. For example, suppose you wanted to store your hash data in an NDBM file named database. Normally, you would say:
tie %hash => NDBM_File, database, $flags, $mode;
to get this history feature, just add Tie::HashHistory before NDBM_File:
my $hh = tie %hash => Tie::HashHistory,
NDBM_File, database, $flags, $mode;
The data will still be stored in database, and it will still be an NDBM file. All the fetching and storing will look the same, but the change history of each key will be available.
The tie call will return an object; to find out the history of a key, use the history method on this object. It takes one argument, which is a key string. It will return a list of all the values that have ever been associated with the key, in chronological order, starting with the most recent. For example:
$hash{a} = first;
$hash{b} = second;
$hash{a} = third; # Overwrites old value
# Prints "third second" as you would expect
print "$hash{a} $hash{b}n";
@values = $hh->history(a);
# @values now contains (third, first)
@values = $hh->history(b);
# @values now contains (second)
At present, if called in scalar context, the history() method will return the number of items in the history. This behavior may change in future versions.
The underlying hash can be any tied hash class at all. To use a regular in-memory hash, use Tie::StdHash (distributed with Perl) as the underlying implementation:
use Tie::Hash; # *NOT Tie::StdHash*
my $hh = tie %hash => Tie::HashHistory, Tie::StdHash;
This is not as efficient as it could be because fetches and stores on %hash still go through two layers of tieing. I may fix this in a future release.
Tie::HashHistory 0.03 Screenshot
Tie::HashHistory 0.03 Keywords
HashHistory
NDBM
HashHistory 0.03
StdHash
changes to
track history
can track
all changes
hash
history
tie
values
key
tied
Tie::HashHistory
TieHashHistory
Bookmark Tie::HashHistory 0.03
Tie::HashHistory 0.03 Copyright
WareSeeker periodically updates pricing and software information of Tie::HashHistory 0.03 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Tie::HashHistory 0.03 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
tied up
tied together with a smile lyrics
history lizzy borden
tie dye
history of computer
history book club
history channel
hashim thaqi
tiedown
history of computers
black history
values education
tiedown straps
rosh hashanah
history of dance
black history month
word accept all changes
hurricane track history
Related Software
Tie::Hash::Sorted Perl module presents hashes in sorted order. Free Download
Tie::Hash::Stack is a Perl module which maintains an array of hashes like a stack. Free Download
Iterator::Misc Perl module package contains miscellaneous iterator functions. Free Download
Rails History Plugin is a Ruby on Rails plugin that stores user actions (i.e. URLs that the user has recently visited). Free Download
Tie::Hash::KeysMask - control key aliasing by mask function, e.g. omit case of character distinction. Free Download
Test::Stochastic is a Perl module to check probabilities of randomized methods. Free Download
Tie::FlatFile::Array is a Perl extension which treats a flatfile database as an array of arrays. Free Download
Siren is a music player for GNOME with an extremely minimalist interface. Free Download
Latest Software
Popular Software
Favourite Software