#!/usr/bin/perl use BerkeleyDB; my $file = shift || die "usage: $0 file"; %hash = (); my $db = tie %hash, 'BerkeleyDB::Hash', -Filename => $file, -Flags => DB_RDONLY, -Property => DB_DUP | DB_DUPSORT or die "can't read file '$file': $!"; my $ref = $db->db_stat; print "db info: \n", map{" - ${_}: ".$ref->{$_}.$/} keys %$ref; print "db contains ", scalar(keys %hash), " entries\n"; print map { " $_ => $hash{$_}\n" } sort keys %hash;