Re: Deleting a subfield using MARC::Record
[email protected] ("Brad Baxter")
| Newsgroups | perl.perl4lib |
|---|---|
| Message-ID | <[email protected]> |
+1 But I have some questions: On 4/30/06, Edward Summers <[email protected]> wrote: [snip] > So effectively there is AND boolean logic between any options that > are supplied. If this looks good I've got some code that does it and > some tests committed in SourceForge for you to take a look at [1]. > I'm open to suggestions on renaming parameters, etc... Here are the > basics for checking out the code if you haven't done it before. [snip] > # 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. And ... # delete second and third subfield u $field->delete_subfield(code => 'u', count => 2, count => 3); (And I'd prefer the first one be 1 not 0.) # delete all subfield u that have 'zombo.com' in them and/or ...? $field->delete_subfield(code => 'u', match = qr/zombo\.com/, match = qr/bimbo\.org/ ); Means which: code eq 'u' and (data =~ /zombo\.com or data =~ /bimbo\.org) -OR- code eq 'u' and (data =~ /zombo\.com and data =~ /bimbo\.org) Regards, -- Brad