logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::Fix::cmd - pipe data to be fixed through an external process

Author

       Nicolas Steenlant, "<nicolas.steenlant at ugent.be>"

Description

       This fix passes data as a JSON object to an external process over stdin and reads a JSON object from it's
       stdout.

Name

       Catmandu::Fix::cmd - pipe data to be fixed through an external process

See Also

       Catmandu::Fix

Synopsis

           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);
           }

Version

       Version 0.0201

See Also