dbMan/Extension/SQLResultPreprocess.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 56 CC 4 SCAR 23.0
CC
4
Cov
0%
handle_action
20.0
IDENTIFICATION
2.0
preference
2.0
CRAP 10.0
1 package DBIx::dbMan::Extension::SQLResultPreprocess;
2  
3 use strict;
4 use base 'DBIx::dbMan::Extension';
5  
6 our $VERSION = '0.06';
7  
8 1;
9  
10 sub IDENTIFICATION { return "000001-000054-000006"; }
11  
12 sub preference { return 50; }
13  
14 sub known_actions { return [ qw/SQL_RESULT/ ]; }
15  
16 sub handle_action {
17 my ($obj,%action) = @_;
18  
19 $action{processed} = 1;
20 if ($action{action} eq 'SQL_RESULT' and not $action{sql_result_preprocess} and ref $action{result} eq 'ARRAY') {
21 @$_ = map { (defined) ? join '',(map { ($_ >= 32 && $_ != 255 && $_ != 127)?chr:sprintf "<%02x>",$_; } unpack "C*",$_) : undef } @$_ for @{$action{result}};
22  
23 $action{sql_result_preprocess} = 1;
24 delete $action{processed};
25 }
26  
27 return %action;
28 }