Re: Deleting a subfield using MARC::Record
[email protected] ("Brad Baxter")
| Newsgroups | perl.perl4lib |
|---|---|
| Message-ID | <[email protected]> |
On 5/1/06, Edward Summers <[email protected]> wrote: > > 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? Of course. I was thinking too shallowly. The suggestions for occur => [1,2] would do the trick. -- Brad