NAME
Tie::History - Perl extension giving scalars, arrays and hashes a history.
SYNOPSIS
use Tie::History;
tie($scalar, 'Tie::History');
$scalar = "Blah blah blah";
tied($scalar)->commit; # Commit the change
$scalar = "More more more";
tied($scalar)->commit; # Commit the change
tie(@array, 'Tie::History');
@array = qw/one two three/;
tie(%hash, 'Tie::History');
$hash{key} = "value";
METHODS
- commit
-
tied($scalar)->commit; tied(@array)->commit; tied(%hash)->commit;Commit the current value into the history.
- previous
-
$previous = tied($scalar)->previous; @previous = tied(@array)->previous; %previous = tied(%hash)->previous;Return the previous committed copy.
- current
-
$current = tied($scalar)->current; @current = tied(@array)->current; %current = tied(%hash)->current;Return the current copy, even if uncommitted.
- get
-
$first = tied($scalar)->get(0); @first = tied(@array)->get(0); %first = tied(%hash)->get(0);Return the copy in the position passed, starting with 0 as the first, and -1 as the last.
- getall
-
@all = tied($scalar)->getall; @all = tied(@array)->getall; @all = tied(%hash)->getall;Return an array with all previous versions committed.
- revert
-
tied($scalar)->revert(1); tied(@array)->revert(1); tied(%hash)->revert(1);Will revert the tied variable back to what position passed. If nothing is passed, it will revert to the last committed item. If the last item committed item is the same as the current, it will revert to the previous item. This may change in the future.
DESCRIPTION
Tie::History will allow you to keep a history of previous versions of a variable, by means of committed the changes. As this is all stored in memory, it is not for use in a production system, but best kept for debugging.
EXPORT
None by default.
SEE ALSO
Tie::HashHistory
Tie::RDBM
AUTHOR
Larry Shatzer <lt>larrysh@cpan.org<gt>
COPYRIGHT AND LICENSE
Copyright 2004 by Larry Shatzer, Jr.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 321:
'=item' outside of any '=over'
- Around line 373:
You forgot a '=back' before '=head1'