#!/usr/bin/perl -w
use strict;

use DB_File;

for my $idx_file (@ARGV) {
    print "Listing '$idx_file':\n";
    tie my %new_idx, 'DB_File', $idx_file, O_RDWR|O_CREAT,
        0666, $DB_BTREE or die "Can't tie $idx_file.new: $!";

    for my $k (keys %new_idx) {
        print "\t$k => ", join(' ', split /$;/, $new_idx{$k}), "\n";
    }
    print "\n";

    untie %new_idx;
}
