push version to 0.24
[Biblio-Isis] / scripts / dump_isisdb.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use blib;
5
6 use Biblio::Isis 0.24;
7 use Getopt::Std;
8
9 BEGIN {
10         eval "use Data::Dump";
11
12         if (! $@) {
13                 *Dumper = *Data::Dump::dump;
14         } else {
15                 use Data::Dumper;
16         }
17 }
18
19 my %opt;
20 getopts('do:l:v', \%opt);
21
22 my $isisdb = shift @ARGV || die "usage: $0 [-v] [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n";
23
24 my $isis = Biblio::Isis->new (
25         isisdb => $isisdb,
26         debug => $opt{'d'} ? 2 : 0,
27         include_deleted => $opt{'v'},
28 #       read_fdt => 1,
29         ignore_empty_subfields => $opt{'v'} ? 0 : 1,
30 );
31
32 print "rows: ",$isis->count,"\n\n";
33
34 my $min = $opt{o} || 1;
35 my $max = $isis->count;
36 $max = ( $min + $opt{l} - 1 ) if ($opt{l});
37
38 for my $mfn ($min .. $max) {
39         print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});
40         print $isis->to_ascii($mfn),"\n";
41
42 }
43