| 1 | # | ||||||||||
| 2 | # $Id: Exec.pm,v 17cc8d9dc427 2023/03/07 06:24:43 gomor $ | ||||||||||
| 3 | # | ||||||||||
| 4 | package OPP::Proc::Exec; | ||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use base qw(OPP::Proc); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | __PACKAGE__->cgBuildIndices; | |||||||||
| 10 | |||||||||||
| 11 | 1 | our $VERSION = '1.00'; | |||||||||
| 12 | |||||||||||
| 13 | # | ||||||||||
| 14 | # Note: script.sh will take the input doc from an input file as only argument | ||||||||||
| 15 | # | ||||||||||
| 16 | # | exec script.sh | ||||||||||
| 17 | # | ||||||||||
| 18 | sub process { | ||||||||||
| 19 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
process: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 20 | 0 | my ($input) = @_; | |||||||||
| 21 | |||||||||||
| 22 | 0 | my $command = $self->options->{0}; | |||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | my $unflatten = $self->unflatten($input) or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 0 | my $json = $self->to_json($unflatten->[0]); | |||||||||
| 26 | 0 | $json =~ s{(?<!\\)'}{\\'}g; | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $new = {}; | |||||||||
| 29 | 0 | $new->{data} = `echo '$json' | $command`; | |||||||||
| 30 | 0 | $self->output->add($new); | |||||||||
| 31 | |||||||||||
| 32 | 0 | return 1; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 1 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||