Catmandu::Fix::Condition::marc_any_match - Test if a MARC (sub)field matches a value
# marc_any_match(MARC_PATH,REGEX) # Match when 245 contains the value "My funny title" if marc_any_match('245','My funny title') add_field('my.funny.title','true') end # Match when 245a contains the value "My funny title" if marc_any_match('245a','My funny title') add_field('my.funny.title','true') end # Match when at least one 650 field contains digits if marc_any_match('650','[0-9]') add_field('has_digits','true') end
Evaluate the enclosing fixes only if the MARC (sub)field matches a regular expression. When the MARC field is a repeated fiels, then at least one MARC fields should match the regular expression.
Evaluates to true when at least one MARC_PATH values matches the REGEX, false otherwise.
Catmandu::Fix::Condition::marc_all_match
To install Catmandu::MARC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::MARC
CPAN shell
perl -MCPAN -e shell install Catmandu::MARC
For more information on module installation, please visit the detailed CPAN module installation guide.