Simple script to dump vacation database.

This commit is contained in:
hjp 2004-08-09 08:08:38 +00:00
parent a43fc516f4
commit a22110e328
1 changed files with 19 additions and 0 deletions

19
vacation_tools/dump-vacation Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/perl
use warnings;
use strict;
use GDBM_File ;
use POSIX qw(strftime);
my $filename = $ARGV[0] ? $ARGV[0] : $ENV{HOME} . "/.vacation.db";
print "$filename\n";
my %db;
tie %db, 'GDBM_File', $filename, &GDBM_WRCREAT, 0640;
while (my ($k, $v) = each(%db)) {
my $t = unpack("L", $v);
my $ts = strftime("%Y-%m-%d %H:%M:%S %z", localtime($t));
print "$ts\t$k\n", ;
}
untie %db;