Re: Using MARC::Record to delete fields

[email protected] ("Ed Summers")
Newsgroups perl.perl4lib
Message-ID <[email protected]>
I can see where Bryan was going with this--but unfortunately
delete_field() does not operate on a list of fields!! I just checked
in delete_fields() and a test for it...but that's not going to help
Michael right now. Here's how I'd delete all but the first 035:

    # get a list of all 035 fields in the record
    my @m035s = $record->field('035');

    # remove the first 035 from the list
    shift(@m035s);

    # delete any that remain in the list
    foreach $field (@m035s) {
        $record->delete_field($field);
    }

This will work with records where there are zero or one 035s as well.
Does it make sense?

//Ed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.