X-Git-Url: http://git.rot13.org/?p=Biblio-Isis;a=blobdiff_plain;f=scripts%2Fdump_isisdb.pl;h=fe7c98cec1c05c508d5807f531f5299b460838f5;hp=d923ba70bb6ea53c1c6e993715ba4c197cdffe56;hb=98df52084ab3942eb11c8db3d977330263faa64a;hpb=a0f367ba3475ceac5185dc8c18b387795415e1b1 diff --git a/scripts/dump_isisdb.pl b/scripts/dump_isisdb.pl index d923ba7..fe7c98c 100755 --- a/scripts/dump_isisdb.pl +++ b/scripts/dump_isisdb.pl @@ -1,29 +1,38 @@ #!/usr/bin/perl -w use strict; -#use blib; +use blib; use Biblio::Isis; use Getopt::Std; -use Data::Dumper; + +BEGIN { + eval "use Data::Dump"; + + if (! $@) { + *Dumper = *Data::Dump::dump; + } else { + use Data::Dumper; + } +} my %opt; -getopts('dn:', \%opt); +getopts('do:l:', \%opt); -my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-d] /path/to/isis/BIBL\n"; +my $isisdb = shift @ARGV || die "usage: $0 [-o offset] [-l limit] [-d] /path/to/isis/BIBL\n"; my $isis = Biblio::Isis->new ( isisdb => $isisdb, - debug => $opt{'d'}, + debug => $opt{'d'} ? 2 : 0, include_deleted => 1, # read_fdt => 1, ); print "rows: ",$isis->count,"\n\n"; -my $min = 1; +my $min = $opt{o} || 1; my $max = $isis->count; -$max = $opt{n} if ($opt{n}); +$max = ( $min + $opt{l} - 1 ) if ($opt{l}); for my $mfn ($min .. $max) { print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});