dbMan/Extension/OutputPager.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 45 CC 3 SCAR 17.5
CC
3
Cov
0%
handle_action
12.0
IDENTIFICATION
2.0
preference
2.0
CRAP 5.8
1 package DBIx::dbMan::Extension::OutputPager;
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-000037-000006"; }
11  
12 sub preference { return -50; }
13  
14 sub known_actions { return [ qw/OUTPUT/ ]; }
15  
16 sub handle_action {
17 my ($obj,%action) = @_;
18  
19 if ($action{action} eq 'OUTPUT' and $action{output_pager} and $obj->{-interface}->can_pager()) {
20 open F,"|less -R";
21 if ( $obj->{ -interface }->is_utf8 ) {
22 binmode F, ':utf8';
23 }
24 print F $action{output};
25 close F;
26 $action{action} = 'NONE';
27 }
28  
29 $action{processed} = 1;
30 return %action;
31 }