5d0500dc7a
- 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)
33 lines
No EOL
505 B
Perl
33 lines
No EOL
505 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 %hash;
|
|
|
|
Stasis::open (\%hash);
|
|
|
|
for(my $i = 0; $i < 4; $i++) {
|
|
$hash{$i} = $i * 10;
|
|
if($i % 2) {
|
|
tied(%hash)->commit();
|
|
} else {
|
|
tied(%hash)->abort();
|
|
}
|
|
}
|
|
for(my $i = 0; $i < 4; $i++) {
|
|
if($i % 2) {
|
|
$hash{$i} == $i * 10 || die;
|
|
} else {
|
|
defined($hash{$i}) && die;
|
|
}
|
|
}
|
|
|
|
print "Exiting"; |