version 1.2, 2002/09/04 20:49:16
|
version 1.3, 2003/09/04 14:32:46
|
Line 35 use GDBM_File;
|
Line 35 use GDBM_File;
|
|
|
# |
# |
# Options |
# Options |
my $unesc = 0; |
my ($unesc,$help,$localize_times) = (0,0,0); |
my $help = 0; |
|
GetOptions("unescape" => \$unesc, |
GetOptions("unescape" => \$unesc, |
"u" => \$unesc, |
"u" => \$unesc, |
|
"t" => \$localize_times, |
"help" => \$help); |
"help" => \$help); |
|
|
# |
# |
Line 52 database.
|
Line 52 database.
|
Options: |
Options: |
--help Display this help. |
--help Display this help. |
--unescape Unescape the keys and values before printing them out. |
--unescape Unescape the keys and values before printing them out. |
--u Same as --unescape |
-u Same as --unescape |
|
-t Localize times when possible (human readable times) |
Examples: |
Examples: |
dump_db.pl mydata.db |
dump_db.pl mydata.db |
dump_db.pl mydata.db yourdata.db ourdata.db theirdata.db |
dump_db.pl mydata.db yourdata.db ourdata.db theirdata.db |
Line 74 while (my $fname = shift) {
|
Line 75 while (my $fname = shift) {
|
$key = &unescape($key); |
$key = &unescape($key); |
$value = &unescape($value); |
$value = &unescape($value); |
} |
} |
|
if ($localize_times) { |
|
if ($value =~ /^\s*([0-9]{10,10})\s*$/) { |
|
$value = $value.' [ '.localtime($1).' ]'; |
|
} |
|
} |
print "$key = $value\n"; |
print "$key = $value\n"; |
} |
} |
untie %db; |
untie %db; |