From a22110e328dc516621581528d3e98448899734f5 Mon Sep 17 00:00:00 2001 From: hjp Date: Mon, 9 Aug 2004 08:08:38 +0000 Subject: [PATCH] Simple script to dump vacation database. --- vacation_tools/dump-vacation | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 vacation_tools/dump-vacation diff --git a/vacation_tools/dump-vacation b/vacation_tools/dump-vacation new file mode 100755 index 0000000..2511617 --- /dev/null +++ b/vacation_tools/dump-vacation @@ -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;