11 getopts('dn:', \%opt);
13 my $file = shift @ARGV || die "usage: $0 [-n number] [-d] file.marc\n";
15 my $marc = new MARC::Fast(
22 my $max = $marc->count;
24 if (my $mfn = $opt{'n'}) {
26 print STDERR "Dumping $mfn only\n";
28 print STDERR "$file has $max records...\n";
31 for my $mfn ($min .. $max) {
32 my $rec = $marc->fetch($mfn) || next;
35 foreach my $f (sort keys %{$rec}) {
36 print "$f\t", join('', $rec->{$f}) ,"\n";
39 print Dumper($marc->to_hash($mfn));