Catman...mporter(3pm)
π NAME π
Catmandu::Fix::Bind::importer β bestie, this is a binder, and what it does is run your fixes on records that come out of an importer. That's the whole vibe. π¦
This page is the 3pm perl module manual for it, so likeβ¦ it's documentation, but make it fashion. π
β¨ SYNOPSIS β¨
Okay so first thing, you can just run it:
#
catmandu run myfix.fix
And then inside your myfix.fix, it's giving:
# with myfix.fix
do importer(OAI,url: "http://lib.ugent.be/oai")
retain(_id)
add_to_exporter(.,YAML)
end
Or β hear me out β as a runnable Fix script, main character style:
# Or in an runnable Fix script:
#!/usr/bin/env catmandu run
add_field(hello,world)
add_to_exporter(.,YAML)
Or, alternatively, this way:
# Or:
#!/usr/bin/env catmandu run
do importer(OAI,url: "http://lib.ugent.be/oai")
retain(_id)
add_to_exporter(.,YAML)
end
πΈ DESCRIPTION πΈ
So the import binder literally computes all the Fix functions on records that get read from the importer you gave it. That's it. That's the job. π«Ά
β οΈ no cap, read this twice: this importer doesn't change the current importer to the given one! Not a swap, not a takeover, none of that.
If you wanna control importers solely by the Fix script, use the catmandu run command line command. That's the one that handles it. π
π CONFIGURATION π
importer(IMPORTER_NAME, step: true|false, IMPORTER_ARGS...)
Loads the importer called IMPORTER_NAME into the current context. Simple. Iconic.
And here's the fun part: when step is 'true', then every single time you execute do importer() only one item gets read from the importer. One. Item. Per run. β¨
This is highkey handy when you've got nested iterators going on, like:
# This will produce:
# {"n":0}
# {"m":0}
# {"n":1}
# {"m":1}
# {"n":2}
# {"m":2}
# ...
do importer(Mock,size:20)
move_field(n,brol)
add_to_exporter(.,JSON)
do importer(Mock,size:20,step:true)
move_field(n,m)
add_to_exporter(.,JSON)
end
end
See how they interleave? n, m, n, m, n, mβ¦ obsessed. The inner one steps one at a time so the outer one can keep doing its thing. Nested iterator slay. π
π₯
π¦ SEE ALSO π¦
Catmandu::Fix::BindCatmandu::Cmd::run
okay that's the page, bestie β this was perl v5.40.1, dated 2026-01-24, and it's the Catman...mporter(3pm) manual, user contributed Perl documentation and all π go read Catmandu::Fix::Bind next, ily, bye πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms