X-Git-Url: http://git.rot13.org/?p=Biblio-Isis;a=blobdiff_plain;f=scripts%2Fdump_isisdb.pl;h=c2f5227c551ce4887f3a669cc50648df8e393f45;hp=19e46c2224b7920b4247f45775b16a03fc56f652;hb=b038a505104c4212dddfa71ab5914b49c3c8e4e7;hpb=7749b1f9d18b2971c788b1bf053e63f50b8f99fc diff --git a/scripts/dump_isisdb.pl b/scripts/dump_isisdb.pl index 19e46c2..c2f5227 100755 --- a/scripts/dump_isisdb.pl +++ b/scripts/dump_isisdb.pl @@ -1,11 +1,20 @@ #!/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); @@ -14,7 +23,7 @@ my $isisdb = shift @ARGV || die "usage: $0 [-n number] [-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, ); @@ -23,6 +32,7 @@ print "rows: ",$isis->count,"\n\n"; my $min = 1; my $max = $isis->count; +$max = $opt{n} if ($opt{n}); for my $mfn ($min .. $max) { print STDERR Dumper($isis->to_hash($mfn)),"\n" if ($opt{'d'});