Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Able to dump multiple DB files

  • Loading branch information...
commit d912b2ed357be7cd0121ca57ed180caf0515ca0c 1 parent 0055bf5
@steveschnepp steveschnepp authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 contrib/dump_db
View
16 contrib/dump_db
@@ -5,14 +5,16 @@
use strict;
use warnings;
-my $db_file = shift;
-
-my %hash;
use Fcntl; # For O_RDWR, O_CREAT, etc.
use DB_File;
-tie(%hash, 'DB_File', $db_file, O_RDONLY) or die "$!";
-for my $key (sort keys %hash) {
- my $value = $hash{$key};
- print "$key\t$value\n";
+while (my $db_file = shift) {
+ my %hash;
+ tie(%hash, 'DB_File', $db_file, O_RDONLY) or die "$!";
+
+ for my $key (sort keys %hash) {
+ my $value = $hash{$key};
+ print "$key\t$value\n";
+ }
+ untie(%hash);
}
Please sign in to comment.
Something went wrong with that request. Please try again.