X-Git-Url: http://git.rot13.org/?p=MARC-Fast;a=blobdiff_plain;f=Fast.pm;h=4ac67e9a5d50046ccc6b5b1c1753a4a49035e3ac;hp=e9a714254bde1f3a1886c152c78c7d5c36a95e1a;hb=be2299900879d2c12a99cb9728a9113c85c6d8e8;hpb=79218e828e9e2e78f8b8c0f54be1ca9b99937d55 diff --git a/Fast.pm b/Fast.pm index e9a7142..4ac67e9 100644 --- a/Fast.pm +++ b/Fast.pm @@ -1,5 +1,5 @@ - package MARC::Fast; + use strict; use Carp; use Data::Dumper; @@ -7,7 +7,7 @@ use Data::Dumper; BEGIN { use Exporter (); use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - $VERSION = 0.04; + $VERSION = 0.05; @ISA = qw (Exporter); #Give a hoot don't pollute, do not export more than needed by default @EXPORT = qw (); @@ -313,17 +313,32 @@ sub to_hash { return $rec; } +=head2 to_ascii -1; -__END__ + print $marc->to_ascii( 42 ); + +=cut -=head1 BUGS +sub to_ascii { + my $self = shift; + my $mfn = shift || confess "need mfn"; + my $row = $self->fetch($mfn) || return; + my $out; -=head1 SUPPORT + foreach my $f (sort keys %{$row}) { + my $dump = join('', @{ $row->{$f} }); + $dump =~ s/\x1e$//; + $dump =~ s/\x1f/\$/g; + $out .= "$f\t$dump\n"; + } + return $out; +} +1; +__END__ =head1 AUTHOR @@ -343,6 +358,6 @@ LICENSE file included with this module. =head1 SEE ALSO -perl(1). +L, perl(1). =cut