r57348 - in /trunk/libmarc-record-perl: ./ debian/ lib/MARC/ lib/MARC/Doc/ lib/MARC/File/ t/
chrisb at users.alioth.debian.org
chrisb at users.alioth.debian.org
Sun May 2 17:42:02 UTC 2010
Author: chrisb
Date: Sun May 2 17:41:53 2010
New Revision: 57348
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57348
Log:
merging in new upstream version 2.0.1
Added:
trunk/libmarc-record-perl/t/67.subfield.t
- copied unchanged from r57347, branches/upstream/libmarc-record-perl/current/t/67.subfield.t
trunk/libmarc-record-perl/t/delete-field.t
- copied unchanged from r57347, branches/upstream/libmarc-record-perl/current/t/delete-field.t
trunk/libmarc-record-perl/t/extra_controlfields.t
- copied unchanged from r57347, branches/upstream/libmarc-record-perl/current/t/extra_controlfields.t
trunk/libmarc-record-perl/t/filler.t
- copied unchanged from r57347, branches/upstream/libmarc-record-perl/current/t/filler.t
trunk/libmarc-record-perl/t/filler.usmarc
- copied unchanged from r57347, branches/upstream/libmarc-record-perl/current/t/filler.usmarc
Modified:
trunk/libmarc-record-perl/Changes
trunk/libmarc-record-perl/MANIFEST
trunk/libmarc-record-perl/META.yml
trunk/libmarc-record-perl/Makefile.PL
trunk/libmarc-record-perl/README
trunk/libmarc-record-perl/debian/changelog
trunk/libmarc-record-perl/lib/MARC/Batch.pm
trunk/libmarc-record-perl/lib/MARC/Doc/Tutorial.pod
trunk/libmarc-record-perl/lib/MARC/Field.pm
trunk/libmarc-record-perl/lib/MARC/File.pm
trunk/libmarc-record-perl/lib/MARC/File/USMARC.pm
trunk/libmarc-record-perl/lib/MARC/Record.pm
trunk/libmarc-record-perl/t/60.insert.t
Modified: trunk/libmarc-record-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/Changes?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/Changes (original)
+++ trunk/libmarc-record-perl/Changes Sun May 2 17:41:53 2010
@@ -1,4 +1,23 @@
Revision history for Perl extension MARC::Record.
+
+2.0.1 Sat May 1 15:59:54 EDT 2010
+ [ENHANCEMENTS]
+ - improve support for subclassing MARC::Field (Dan Wells)
+ - RT#55993: MARC::Record->insert_fields_after can now insert
+ after last field in record (Frédéric Demians)
+ - added methods to MARC::Field to allow a (class-level) list of
+ fields that should be considered control fields in addition
+ to 001-009. Includes test t/extra_controlfields.t, and
+ supports alphabetic characters in the tag labels. The new
+ methods are
+ allow_controlfield_tags
+ disallow_controlfield_tags
+ is_controlfield_tag
+ (Bill Dueber)
+ - added MARC::Record::delete_fields() and t/delete-field.t
+ (Ed Summers)
+ - documentation improvements (Mike Rylander and Dan Scott)
+ - baked in minimum Perl version required: 5.8.2
2.0
[THINGS THAT MAY BREAK YOUR CODE]
Modified: trunk/libmarc-record-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/MANIFEST?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/MANIFEST (original)
+++ trunk/libmarc-record-perl/MANIFEST Sun May 2 17:41:53 2010
@@ -1,19 +1,17 @@
+bin/marcdump
Changes
-MANIFEST
-Makefile.PL
-META.yml
-README
-bin/marcdump
-
lib/MARC/Batch.pm
lib/MARC/Doc/Tutorial.pod
lib/MARC/Field.pm
+lib/MARC/File.pm
lib/MARC/File/Encode.pm
lib/MARC/File/MicroLIF.pm
-lib/MARC/File.pm
lib/MARC/File/USMARC.pm
lib/MARC/Record.pm
-
+Makefile.PL
+MANIFEST
+META.yml
+README
t/00.load.t
t/10.camel.t
t/11.astring.t
@@ -29,6 +27,7 @@
t/64.create.t
t/66.grouped.t
t/66.ordered.t
+t/67.subfield.t
t/70.croak.t
t/75.warnings.t
t/80.alphatag.t
@@ -45,19 +44,23 @@
t/cameleof.usmarc
t/convenience.t
t/decode-filter.t
+t/delete-field.t
t/delete-subfield.t
t/dosEOF.t
+t/extra_controlfields.t
t/file-filter.t
t/file-header.t
+t/filler.t
+t/filler.usmarc
t/lineendings-0a.lif
+t/lineendings-0d.lif
t/lineendings-0d0a.lif
-t/lineendings-0d.lif
t/lineendings.t
+t/pod-coverage.t
t/pod.t
-t/pod-coverage.t
-t/sample100.lif
t/sample1.lif
t/sample1.usmarc
+t/sample100.lif
t/sample1eof.usmarc
t/sample20.lif
t/title_proper.t
Modified: trunk/libmarc-record-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/META.yml?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/META.yml (original)
+++ trunk/libmarc-record-perl/META.yml Sun May 2 17:41:53 2010
@@ -1,14 +1,25 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: MARC-Record
-version: 2.0.0
-version_from: lib/MARC/Record.pm
-installdirs: site
+--- #YAML:1.0
+name: MARC-Record
+version: 2.0.1
+abstract: Perl extension for handling MARC records
+author:
+ - Galen Charlton <gmcharlt at gmail.com>
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
requires:
- Carp: 0
- File::Find: 0
- File::Spec: 0
- Test::More: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+ Carp: 0
+ File::Find: 0
+ File::Spec: 0
+ Test::More: 0
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.52
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: trunk/libmarc-record-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/Makefile.PL?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/Makefile.PL (original)
+++ trunk/libmarc-record-perl/Makefile.PL Sun May 2 17:41:53 2010
@@ -1,5 +1,5 @@
# vi:et:sw=4 ts=4
-require v5.8.1;
+require v5.8.2;
use strict;
use ExtUtils::MakeMaker;
@@ -9,7 +9,7 @@
VERSION_FROM => 'lib/MARC/Record.pm',
ABSTRACT_FROM => 'lib/MARC/Record.pm',
PMLIBDIRS => [ qw( lib/ ) ],
- AUTHOR => 'Andy Lester <andy at petdance.com>',
+ AUTHOR => 'Galen Charlton <gmcharlt at gmail.com>',
PREREQ_PM => {
'Test::More' => 0,
'File::Spec' => 0,
Modified: trunk/libmarc-record-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/README?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/README (original)
+++ trunk/libmarc-record-perl/README Sun May 2 17:41:53 2010
@@ -41,13 +41,10 @@
DEPENDENCIES
-MARC::Record now requires a perl version >= 5.8.1 for processing unicode
+MARC::Record now requires a perl version >= 5.8.2 for processing unicode
correctly.
COPYRIGHT AND LICENCE
This software is free software and may be distributed under the same
terms as Perl itself .
-
-Copyright (C) 2001-2002 Andy Lester <marc at petdance.com>
-
Modified: trunk/libmarc-record-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/debian/changelog?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/debian/changelog (original)
+++ trunk/libmarc-record-perl/debian/changelog Sun May 2 17:41:53 2010
@@ -1,4 +1,4 @@
-libmarc-record-perl (2.0.0-3) UNRELEASED; urgency=low
+libmarc-record-perl (2.0.1-1) UNRELEASED; urgency=low
[ gregor herrmann ]
* debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -10,7 +10,10 @@
[ gregor herrmann ]
* Change my email address.
- -- Rene Mayorga <rmayorga at debian.org> Tue, 20 Jan 2009 01:27:56 -0600
+ [ Chris Butler ]
+ * New upstream release
+
+ -- Chris Butler <chrisb at debian.org> Sun, 02 May 2010 18:32:17 +0100
libmarc-record-perl (2.0.0-2) unstable; urgency=low
Modified: trunk/libmarc-record-perl/lib/MARC/Batch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/Batch.pm?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/Batch.pm (original)
+++ trunk/libmarc-record-perl/lib/MARC/Batch.pm Sun May 2 17:41:53 2010
@@ -11,6 +11,11 @@
multiple-file aspects.
use MARC::Batch;
+
+ # If you have werid control fields...
+ use MARC::Field;
+ MARC::Field->allow_controlfield_tags('FMT', 'LDX');
+
my $batch = MARC::Batch->new( 'USMARC', @files );
while ( my $marc = $batch->next ) {
Modified: trunk/libmarc-record-perl/lib/MARC/Doc/Tutorial.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/Doc/Tutorial.pod?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/Doc/Tutorial.pod (original)
+++ trunk/libmarc-record-perl/lib/MARC/Doc/Tutorial.pod Sun May 2 17:41:53 2010
@@ -33,7 +33,7 @@
version at CPAN: http://www.cpan.org/modules/by-module/MARC/. You'll notice
that some sections aren't filled in yet, which is a result of this document
being a work in progress. If you have ideas for new sections please make a
-suggestion to perl4lib: http://www.rice.edu/perl4lib/.
+suggestion to perl4lib: http://perl4lib.perl.org/.
=head2 History of MARC on CPAN
Modified: trunk/libmarc-record-perl/lib/MARC/Field.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/Field.pm?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/Field.pm (original)
+++ trunk/libmarc-record-perl/lib/MARC/Field.pm Sun May 2 17:41:53 2010
@@ -16,6 +16,9 @@
=head1 SYNOPSIS
use MARC::Field;
+
+ # If your system uses wacky control field tags, add them
+ MARC::Field->allow_controlfield_tags('FMT', 'LLE');
my $field = MARC::Field->new( 245, '1', '0',
'a' => 'Raccoons and ripe corn / ',
@@ -33,6 +36,18 @@
None by default. Any errors are stored in C<$MARC::Field::ERROR>, which
C<$MARC::Record> usually bubbles up to C<$MARC::Record::ERROR>.
+=head1 CLASS VARIABLES
+
+B<extra_controlfield_tags>: Some systems (notably Ex Libris's Aleph) throw
+extra control fields in their MARC (e.g., Aleph's MARC-XML tends to have a
+C<FMT> control field). We keep a class-level hash to track to track them; it can
+be manipulated with C<allow_controlfield_tags> and c<disallow_controlfield_tags>.
+
+=cut
+
+my %extra_controlfield_tags = ();
+
+
=head1 METHODS
=head2 new()
@@ -47,7 +62,7 @@
'c' => 'Jim Arnosky.'
);
-Or if you want to add a field < 010 that does not have indicators.
+Or if you want to add a control field (< 010) that does not have indicators.
my $field = MARC::Field->new( '001', ' 14919759' );
@@ -59,11 +74,14 @@
## MARC spec indicates that tags can have alphabetical
## characters in them! If they do appear we assume that
- ## they have indicators like tags > 010
+ ## they have indicators like tags > 010 unless they've
+ ## been previously defined as control tags using
+ ## add_controlfield
+
my $tagno = shift;
($tagno =~ /^[0-9A-Za-z]{3}$/)
or croak( "Tag \"$tagno\" is not a valid tag." );
- my $is_control = (($tagno =~ /^\d+$/) && ($tagno < 10));
+ my $is_control = $class->is_controlfield_tag($tagno);
my $self = bless {
_tag => $tagno,
@@ -73,10 +91,12 @@
if ( $is_control ) {
$self->{_data} = shift;
+ $self->_warn("Too much data for control field '$tagno'") if (@_);
} else {
for my $indcode ( qw( _ind1 _ind2 ) ) {
my $indicator = shift;
- if ( $indicator !~ /^[0-9A-Za-z ]$/ ) {
+ scalar(@_) or croak("Field $tagno must have indicators (use ' ' for empty indicators)");
+ if ($indicator !~ /^[0-9A-Za-z ]$/ ) {
$self->_warn( "Invalid indicator \"$indicator\" forced to blank" ) unless ($indicator eq "");
$indicator = " ";
}
@@ -117,7 +137,7 @@
my $self = shift;
my $indno = shift;
- $self->_warn( "Fields below 010 do not have indicators" )
+ $self->_warn( "Control fields (generally, those with tags below 010) do not have indicators" )
if $self->is_control_field;
if ( $indno == 1 ) {
@@ -129,6 +149,57 @@
}
}
+=head2 allow_controlfield_tags($tag, $tag2, ...)
+
+Add $tags to class-level list of strings to consider valid control fields tags (in addition to 001 through 009).
+Tags must have three characters.
+
+=cut
+
+sub allow_controlfield_tags {
+ my $self = shift;
+ foreach my $tag (@_) {
+ $extra_controlfield_tags{$tag} = 1;
+ }
+}
+
+=head2 disallow_controlfield_tags($tag, $tag2, ...)
+=head2 disallow_controlfield_tags('*')
+
+Revoke the validity of a control field tag previously added with allow_controlfield_tags. As a special case,
+if you pass the string '*' it will clear out all previously-added tags.
+
+NOTE that this will only deal with stuff added with allow_controlfield_tags; you can't disallow '001'.
+
+=cut
+
+sub disallow_controlfield_tags {
+ my $self = shift;
+ if ($_[0] eq '*') {
+ %extra_controlfield_tags = ();
+ return;
+ }
+ foreach my $tag (@_) {
+ delete $extra_controlfield_tags{$tag};
+ }
+}
+
+=head2 is_controlfield_tag($tag) -- does the given tag denote a control field?
+
+Generally called as a class method (e.g., MARC::Field->is_controlfield_tag('001'))
+
+=cut
+
+sub is_controlfield_tag
+{
+ my $self = shift;
+ my $tag = shift;
+ return 1 if ($extra_controlfield_tags{$tag});
+ return 1 if (($tag =~ /^\d+$/) && ($tag < 10));
+ return 0; # otherwise, it's not a control field
+}
+
+
=head2 is_control_field()
Tells whether this field is one of the control tags from 001-009.
@@ -155,7 +226,7 @@
If no matching subfields are found, C<undef> is returned in a scalar context
and an empty list in a list context.
-If the tag is less than an 010, C<undef> is returned and
+If the tag is a control field, C<undef> is returned and
C<$MARC::Field::ERROR> is set.
=cut
@@ -164,7 +235,7 @@
my $self = shift;
my $code_wanted = shift;
- croak( "Fields below 010 do not have subfields, use data()" )
+ croak( "Control fields (generally, just tags below 010) do not have subfields, use data()" )
if $self->is_control_field;
my @data = @{$self->{_subfields}};
@@ -197,7 +268,7 @@
sub subfields {
my $self = shift;
- $self->_warn( "Fields below 010 do not have subfields" )
+ $self->_warn( "Control fields (generally, just tags below 010) do not have subfields" )
if $self->is_control_field;
my @list;
@@ -217,7 +288,7 @@
sub data {
my $self = shift;
- croak( "data() is only for tags less than 010, use subfield()" )
+ croak( "data() is only for control fields (generally, just tags below 010) , use subfield()" )
unless $self->is_control_field;
$self->{_data} = $_[0] if @_;
@@ -238,7 +309,7 @@
sub add_subfields {
my $self = shift;
- croak( "Subfields are only for tags >= 10" )
+ croak( "Subfields are only for data fields (generally, just tags >= 010)" )
if $self->is_control_field;
push( @{$self->{_subfields}}, @_ );
@@ -501,14 +572,14 @@
=head2 as_usmarc()
Returns a string for putting into a USMARC file. It's really only
-useful by C<MARC::Record::as_usmarc()>.
+useful for C<MARC::Record::as_usmarc()>.
=cut
sub as_usmarc() {
my $self = shift;
- # Tags < 010 are pretty easy
+ # Control fields are pretty easy
if ( $self->is_control_field ) {
return $self->data . END_OF_FIELD;
} else {
@@ -545,7 +616,7 @@
my $self = shift;
my $tagno = $self->{_tag};
- my $is_control = (($tagno =~ /^\d+$/) && ($tagno < 10));
+ my $is_control = $self->is_controlfield_tag($tagno);
my $clone =
bless {
Modified: trunk/libmarc-record-perl/lib/MARC/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/File.pm?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/File.pm (original)
+++ trunk/libmarc-record-perl/lib/MARC/File.pm Sun May 2 17:41:53 2010
@@ -14,6 +14,10 @@
=head1 SYNOPSIS
use MARC::File::USMARC;
+
+ # If you have werid control fields...
+ use MARC::Field;
+ MARC::Field->allow_controlfield_tags('FMT', 'LDX');
my $file = MARC::File::USMARC->in( $filename );
Modified: trunk/libmarc-record-perl/lib/MARC/File/USMARC.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/File/USMARC.pm?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/File/USMARC.pm (original)
+++ trunk/libmarc-record-perl/lib/MARC/File/USMARC.pm Sun May 2 17:41:53 2010
@@ -16,6 +16,7 @@
use vars qw( @ISA ); @ISA = qw( MARC::File );
use MARC::Record qw( LEADER_LEN );
+use MARC::Field;
use constant SUBFIELD_INDICATOR => "\x1F";
use constant END_OF_FIELD => "\x1E";
use constant END_OF_RECORD => "\x1D";
@@ -188,7 +189,7 @@
next unless $filter_func->( $tagno, $tagdata );
}
- if ( ($tagno =~ /^\d+$/) && ($tagno < 10) ) {
+ if ( MARC::Field->is_controlfield_tag($tagno) ) {
$marc->append_fields( MARC::Field->new( $tagno, $tagdata ) );
} else {
my @subfields = split( SUBFIELD_INDICATOR, $tagdata );
Modified: trunk/libmarc-record-perl/lib/MARC/Record.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/lib/MARC/Record.pm?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/lib/MARC/Record.pm (original)
+++ trunk/libmarc-record-perl/lib/MARC/Record.pm Sun May 2 17:41:53 2010
@@ -16,12 +16,12 @@
=head1 VERSION
-Version 2.0.0
+Version 2.0.1
=cut
use vars qw( $VERSION );
-$VERSION = '2.0.0';
+$VERSION = '2.0.1';
use Exporter;
use vars qw( @ISA @EXPORTS @EXPORT_OK );
@@ -245,7 +245,7 @@
sub _all_parms_are_fields {
for ( @_ ) {
- return 0 unless ref($_) eq 'MARC::Field';
+ return 0 unless UNIVERSAL::isa($_, 'MARC::Field');
}
return 1;
}
@@ -327,13 +327,17 @@
## find position of $after
my $fields = $self->{_fields};
my $pos = 0;
+ my $found = 0;
foreach my $f (@$fields) {
- last if ($f == $after);
+ if ($f == $after) {
+ $found = 1;
+ last;
+ }
$pos++;
}
## insert after $after
- if ($pos+1 >= @$fields) {
+ unless ($found) {
$self->_warn("Couldn't find field to insert after");
return;
}
@@ -417,31 +421,41 @@
}
-=head2 delete_field( $field )
-
-Deletes a field from the record.
-
-The field must have been retrieved from the record using the
-C<field()> method. For example, to delete a 526 tag if it exists:
-
- my $tag526 = $marc->field( "526" );
- if ( $tag526 ) {
- $marc->delete_field( $tag526 );
- }
-
-C<delete_field()> returns the number of fields that were deleted.
-This shouldn't be 0 unless you didn't get the tag properly.
+=head2 delete_fields( $field )
+
+Deletes a given list of MARC::Field objects from the the record.
+
+ # delete all note fields
+ my @notes = $record->field('5..');
+ $record->delete_fields(@notes);
+
+delete_fields() will return the number of fields that were deleted.
+
+=cut
+
+sub delete_fields {
+ my $self = shift;
+ _all_parms_are_fields(@_) or croak('Arguments must be MARC::Field object');
+ my @fields = @{$self->{_fields}};
+ my $original_count = @fields;
+
+ foreach my $deleter (@_) {
+ @fields = grep { $_ != $deleter } @fields;
+ }
+ $self->{_fields} = \@fields;
+
+ return $original_count - @fields;
+}
+
+=head2 delete_field()
+
+Same thing as delete_fields() but only expects a single MARC::Field to be passed
+in. Mainly here for backwards compatibility.
=cut
sub delete_field {
- my $self = shift;
- my $deleter = shift;
- my $list = $self->{_fields};
-
- my $old_count = @$list;
- @$list = grep { $_ != $deleter } @$list;
- return $old_count - @$list;
+ return delete_fields(@_);
}
=head2 as_usmarc()
@@ -525,10 +539,10 @@
# when setting
if ( defined($arg) ) {
- if ( $arg =~ /UTF-8/i ) {
+ if ( $arg =~ /UTF-?8/i ) {
substr($leader,9,1) = 'a';
}
- elsif ( $arg =~ /MARC-8/i ) {
+ elsif ( $arg =~ /MARC-?8/i ) {
substr($leader,9,1) = ' ';
}
$self->leader($leader);
@@ -547,6 +561,9 @@
my $self = shift;
my $reclen = shift;
my $baseaddr = shift;
+ if ($reclen > 99999) {
+ carp( "Record length of $reclen is larger than the MARC spec allows (99999 bytes)." );
+ }
substr($self->{_leader},0,5) = sprintf("%05d",$reclen);
substr($self->{_leader},12,5) = sprintf("%05d",$baseaddr);
# MARC21 defaults: http://www.loc.gov/marc/bibliographic/ecbdldrd.html
@@ -678,7 +695,7 @@
last; # Bail out, we're done eating parms
# User handed us an object.
- } elsif ( ref($parm) eq "MARC::Field" ) {
+ } elsif ( UNIVERSAL::isa($parm, 'MARC::Field') ) {
push( @$fields, $parm );
++$nfields;
@@ -765,7 +782,7 @@
=over 4
-=item * perl4lib (L<http://www.rice.edu/perl4lib/>)
+=item * perl4lib (L<http://perl4lib.perl.org/>)
A mailing list devoted to the use of Perl in libraries.
@@ -779,7 +796,7 @@
Online version of the free booklet. An excellent overview of the MARC format. Essential.
-=item * Tag Of The Month (L<http://www.tagofthemonth.com/>)
+=item * Tag Of The Month (L<http://www.follettsoftware.com/sub/tag_of_the_month/>)
Follett Software Company's
(L<http://www.fsc.follett.com/>) monthly discussion of various MARC tags.
@@ -846,9 +863,19 @@
Please note that these modules are not products of or supported by the
employers of the various contributors to the code.
-=head1 AUTHOR
-
-Andy Lester, C<< <andy at petdance.com> >>
-
-=cut
-
+=head1 AUTHORS
+
+=over 4
+
+=item * Andy Lester
+
+=item * Mike O'Regan
+
+=item * Ed Summers
+
+=item * Mike Rylander
+
+=back
+
+=cut
+
Modified: trunk/libmarc-record-perl/t/60.insert.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmarc-record-perl/t/60.insert.t?rev=57348&op=diff
==============================================================================
--- trunk/libmarc-record-perl/t/60.insert.t (original)
+++ trunk/libmarc-record-perl/t/60.insert.t Sun May 2 17:41:53 2010
@@ -4,7 +4,7 @@
use integer;
use File::Spec;
-use Test::More tests=>16;
+use Test::More tests=>20;
BEGIN {
use_ok( 'MARC::Batch' );
@@ -121,6 +121,20 @@
$n = $record->delete_field($newagain);
is( $n, 1 );
+# marker field for last field of record - testing rt55993
+my $new999 = MARC::Field->new('999', ' ', ' ', a => 'last field');
+$nappended = $record->append_fields($new999);
+is ( $nappended, 1, 'added 999 field as last field (RT#55993 test)' );
+
+$nadds = $record->insert_fields_after($new999,$newagain);
+
+is( $nadds, 1, 'added 650 after last field in record (RT#55993 test)' );
+
+$n = $record->delete_field($newagain);
+is( $n, 1 );
+
+$n = $record->delete_field($new999);
+is( $n, 1, 'deleted 999 field' );
## test insert_record_before
More information about the Pkg-perl-cvs-commits
mailing list