Catman...reaker(3pm)
π NAME π
Catmandu::Cmd::breaker β bestie, this is the little catmandu sub-command that parses Catmandu::Breaker exports π
It's a Perl module, it lives in the 3pm section of the manual (that's the Catman...reaker(3pm) page you're reading rn), and it ships as part of the User Contributed Perl Documentation. She's not doing anything wild, she's just reading .breaker files and telling you what's inside them β¨
β¨ EXAMPLES β¨
Okay so here's the whole vibe. The shape of the command is:
catmandu breaker [<OPTIONS>] <BREAKER.FILE>
First you gotta make a breaker file, and you do that by converting something into the Breaker format:
$ catmandu convert XML --path book to Breaker --handler xml < t/book.xml > data.breaker
$ catmandu breaker data.breaker
Then if you want the tea in full detail, hit it with -v for verbose output πΈ
# verbose output
$ catmandu breaker -v data.breaker
Now, the important part π
The breaker command needs to know the unique fields in the dataset so it can build statistics. By default it will scan the whole file for fields β and bestie, that can be a very time consuming process π So if you don't wanna sit there forever, --maxscan lets you limit the number of lines in the breaker file that can be scanned for unique fields:
# The breaker command needs to know the unique fields in the dataset to build statistics
# By default it will scan the whole file for fields. This can be a very
# time consuming process. With --maxscan one can limit the number of lines
# in the breaker file that can be scanned for unique fields
$ catmandu breaker -v --maxscan 1000000 data.breaker
OR β and this is the shortcut, the main character move π β you can just tell it the unique fields yourself with the fields option:
# Alternatively the fields option can be used to specify the unique fields
$ catmandu breaker -v --fields 245a,022a data.breaker
And if your fields live in a file? Say less. You can pipe the second column out, dedupe it, and hand the whole file over:
$ cat data.breaker | cut -f 2 | sort -u > fields.txt
$ catmandu breaker -v --fields fields.txt data.breaker
Last one β you can export the statistics as CSV π¦ (peep Catmandu::Exporter::Stat for all the supported formats):
# Export statistics as CSV. See L<Catmandu::Exporter::Stat> for supported formats.
$ catmandu breaker --as CSV data.breaker
Reminder for your own good: the default whole-file field scan is the slow one.--maxscanor--fieldsare your friends, fr fr π«Ά
That's the whole page, bestie β Catmandu::Cmd::breaker, straight out of the User Contributed Perl Documentation, and she ate β¨ Signing off from perl v5.36.0, dated 2023-02-08, on the page Catman...reaker(3pm) πππ¦
π¦ where this page comes from
- debian bookworm: libcatmandu-breaker-perl 0.141-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatmandu-breaker-perl 0.141-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-breaker-perl 0.141-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-breaker-perl 0.141-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-breaker-perl 0.141-2 Β· 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