Porf/examples/short_array.pl untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 2 SCAR 12.8
CC
2
Cov
0%
run_example
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 # perl
2 #
3 # Minimal report example using shortest options,
4 # data rows given as array reference
5 #
6 # PORF Perl Open Report Framework
7 #
8 # Ralf Peine, Wed May 14 10:39:49 2014
9 #
10 #------------------------------------------------------------------------------
11  
12 use warnings;
13 use strict;
14  
15 use Report::Porf::Framework;
16  
17 sub run_example {
18 my $person_rows = shift; # Param1: Reference to list of arrays
19 my $format = shift; # Param2: Optional: format of report
20  
21 $format = 'text' unless $format;
22  
23 # --- create Report -------------------------------------------------------
24 my $report_frame_work = Report::Porf::Framework::get();
25 my $r = $report_frame_work->create_report($format);
26  
27 # $r->set_verbose(3); # uncomment to see infos about configuring phase
28  
29 # --- Configure Report ----------------------------------------------------
30  
31 # store info about data columns
32 # my $count_idx = 0; # not used!
33 my $prename_idx = 1;
34 my $surname_idx = 2;
35 my $age_idx = 3;
36 # my $time_idx = 4; # not used!
37
38 $r->cc(-h => 'Prename', -vi => $prename_idx);
39 $r->cc(-h => 'Surname', -vi => $surname_idx);
40 $r->cc(-h => 'Age', -vi => $age_idx );
41  
42 $r->configure_complete();
43  
44 # --- print out table -----------------------------------
45  
46 $r->write_all($person_rows); # print STDOUT ...
47  
48 # --- return count of entries ---------------------------
49  
50 return (scalar @{$person_rows});
51 }
52  
53 1;