stasis-aries-wal/lang/perl/t/07-hash-in-autohash.t
Sears Russell 5d0500dc7a Perl updates:
- Cleaned up initialization and shutdown.
 - Add support for autocommitted hashes
 - Wrote preliminary perldocs
 - Updated sample cgi scripts. 
 - Added new (partial) wiki thing
 - Added stasis.pl (a simple toplevel)
2010-02-17 05:05:23 +00:00

41 lines
494 B
Perl

#!/usr/bin/perl -w
use strict;
use Stasis;
my $checking;
if(@ARGV && $ARGV[0] eq "--automated-test") {
shift @ARGV;
system ("rm storefile.txt logfile.txt");
$checking = 1;
}
my %h;
Stasis::open(\%h);
Stasis::Tbegin();
my %i;
$h{foo} = \%i;
tied(%h)->commit();
$h{foo}{bar} = "x";
my $i = $h{foo};
tied(%h)->commit();
$$i{baz} = "y";
$$i{bat} = "z";
Stasis::Tdeinit();
Stasis::open(\%h);
Stasis::Tbegin();
Stasis::Tbegin();
$h{foo}{baz} = "bat";
$h{foo}{bar} == "x" || die;