Re: Deleting a subfield using MARC::Record

[email protected] (Edward Summers)
Newsgroups perl.perl4lib
Message-ID <[email protected]>
On May 1, 2006, at 1:24 PM, Brad Baxter wrote:
>> # delete first two subfield u
>> $field->delete_subfield(code => 'u', count => 2);
>
> I don't think I like it this way.  How would you delete just the  
> second one?
> I'd rather see 'count' mean 'occurrence', so the above would mean
> delete the second subfield u.

Yeah, I like your suggestion of using 'occurrence' over 'count' here.

> And ...
>
> # delete second and third subfield u
> $field->delete_subfield(code => 'u', count => 2, count => 3);

This won't translate very well to passing in arguments as a hash,  
since the second count will stomp on the first. Have you actually had  
to any real need to delete this way in the past?

//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.