X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=scripts%2Fdump_fastmarc.pl;h=ff2c0af9e02e70975d2d470ecc0a7b0d1fb8a42e;hb=3155b9de32d2a7c8231fb4599b9061362ee775f7;hp=b1d87023e2a77da918a34b2e3ef6e82dcb817d79;hpb=79218e828e9e2e78f8b8c0f54be1ca9b99937d55;p=MARC-Fast diff --git a/scripts/dump_fastmarc.pl b/scripts/dump_fastmarc.pl index b1d8702..ff2c0af 100755 --- a/scripts/dump_fastmarc.pl +++ b/scripts/dump_fastmarc.pl @@ -5,7 +5,7 @@ use blib; use MARC::Fast; use Getopt::Std; -use Data::Dumper; +use Data::Dump qw/dump/; =head1 NAME @@ -65,14 +65,9 @@ if (my $mfn = $opt{n}) { for my $mfn ($min .. $max) { my $rec = $marc->fetch($mfn) || next; - print "rec is ",Dumper($rec) if ($opt{d}); + print "rec is ",dump($rec) if ($opt{d}); print "REC $mfn\n"; - foreach my $f (sort keys %{$rec}) { - my $dump = join('', @{ $rec->{$f} }); - $dump =~ s/\x1e$//; - $dump =~ s/\x1f/\$/g; - print "$f\t$dump\n"; - } - print "\n"; - print "hash is ",Dumper($marc->to_hash($mfn)) if ($opt{h}); + print $marc->last_leader,"\n"; + print $marc->to_ascii($mfn),"\n"; + print "hash is ",dump($marc->to_hash($mfn, include_subfields => 1)) if ($opt{h}); }