Catman...x::cmd(3pm)

πŸ’– Catmandu::Fix::cmd πŸ’–

okay bestie, buckle up, because this is the manual page for Catman...x::cmd(3pm) β€” yes that's the manual name, it's giving "truncated by the renderer" energy but we move 🫢 β€” and it's a Perl fix that pipes your data through an external process. slay.


✨ NAME ✨

Catmandu::Fix::cmd β€” pipe data to be fixed through an external process. that's the whole vibe. external process, data goes in, data comes out, main character energy for your JSON πŸ’…


🌸 VERSION 🌸

Version 0.0201. iconic. noted. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the way this works is: this fix passes data as a JSON object to an external process over stdin, and then reads a JSON object back from its stdout. that's it. that's the whole relationship. a lil data handoff between you and some other program. no cap πŸ’œ


πŸŽ€ SYNOPSIS πŸŽ€

here's the look, bestie:

    my $fixer = Catmandu::Fix->new(fixes => [
        # pipe data through the jq command-line json processor
        # keeping only the title field
        'cmd("jq -c -M {title}")',
        # ...
    ]);

    # a canonical external program in perl
    use JSON;
    while (<STDIN>) {
        my $data = decode_json($_);
        # ...
        print encode_json($data);
    }

see that first one? you're piping data through the jq command-line json processor and keeping only the title field. taste. and then below it there's a canonical external program in perl doing the same little dance β€” read a line from STDIN, decode_json it, do stuff, print encode_json($data) right back out. a whole conversation. obsessed πŸ˜­πŸ’–


🌈 SEE ALSO 🌈

  • Catmandu::Fix β€” the whole fix family, iykyk

πŸ‘‘ AUTHOR πŸ‘‘

Nicolas Steenlant, "<nicolas.steenlant at ugent.be>" β€” we love a credited author, give them their flowers fr fr πŸŽ€


okay legal bestie moment, listen up:

This program is free software; you can redistribute it and/or modify it under the terms of either:

  1. the GNU General Public License as published by the Free Software Foundation; or
  2. the Artistic License.

See http://dev.perl.org/licenses/ for more information.

yes you can have either one. yes that's the whole deal. no cap 🫢

and that's the page, bestie!! it came to you from perl v5.36.0, dated 2023-02-04, and it's filed under Catman...x::cmd(3pm) β€” go forth and pipe things through other things, you've got this πŸ’…βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from