Catmandu::Fix::Bind::mab_each(3pm)

Catmandu::Fix::Bind::mab_each3pm

A binder that loops over mab2 fields

Usage

    # Only add field 331 to the title when field 412 matches 'Heise'
    do mab_each()
        if mab_match("412","Heise")
            mab_map("331",title)
        end
    end
    # Delete all the 700 subject fields
    do mab_each()
        if mab_match("700",".*")
            reject()
        end
    end

Overview

The mab_each binder will iterate over each individual MAB2 field and execute the fixes only in context over each individual field.

If a MAB2 record contains:

    705    $a775.05$c775
    705    $a702.08$c702

then the fix

    do mab_each()
        mab_map("705a",subject.$append)
    end

will have the same effect as

    mab_map("705a",subject.$append)

because "mab_map" by default loops over all repeated MAB2 fields. But the "mab_each" bind has the advantage to process fields in context. E.g. to only map fields where the subfield $c doesn't contain '702' you can write:

    do mab_each()
        unless mab_match("705","702")
            mab_map("705",subject.$append)
        end
    end

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10
  3. 11
  4. 12–13

Author

Johann Rolschewski <[email protected]>

From libcatmandu-mab2-perl 0.24-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.