Basic/Three.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 51 CC 1 SCAR 6.9
CC
1
Cov
0%
cgiapp_get_query
2.0
cgiapp_init
2.0
setup
2.0
CRAP 2.0
1 package CGI::Application::Demo::Basic::Three;
2  
3 # Documentation:
4 # POD-style documentation is at the end. Extract it with pod2html.*.
5 #
6 # Note:
7 # o tab = 4 spaces || die
8 #
9 # Author:
10 # Ron Savage <ron@savage.net.au>
11 # http://savage.net.au/index.html
12  
13 use base 'CGI::Application';
14 use strict;
15 use warnings;
16  
17 require 5.005_62;
18  
19 use CGI::Application::Demo::Basic::Util::Config;
20 use CGI::Simple;
21  
22 our $VERSION = '1.06';
23  
24 # -----------------------------------------------
25  
26 sub cgiapp_get_query
27 {
28 my($self) = @_;
29  
30 return CGI::Simple -> new;
31  
32 } # End of cgiapp_get_query.
33  
34 # -----------------------------------------------
35  
36 sub cgiapp_init
37 {
38 my($self) = @_;
39 my($config) = CGI::Application::Demo::Basic::Util::Config -> new('three.conf') -> config;
40  
41 $self -> param(config => $config);
42 $self -> param(tmpl_name => $$config{'tmpl_name'});
43 $self -> param(tmpl_path => $$config{'tmpl_path'});
44  
45 } # End of cgiapp_init.
46  
47 # -----------------------------------------------
48  
49 sub setup
50 {
51 my($self) = @_;
52  
53 $self -> run_modes(start => \&start);
54 $self -> tmpl_path($self -> param('tmpl_path') );
55  
56 } # End of setup.
57  
58 # -----------------------------------------------
59  
60 sub start
61 {
62 my($self) = shift;
63 my($template) = $self -> load_tmpl($self -> param('tmpl_name') );
64 my(@content) =
65 (
66 'Time: ' . scalar localtime,
67 'URL: ' . $self -> query -> url,
68 'PathInfo: ' . $self -> query -> path_info,
69 "CGI::Simple V $CGI::Simple::VERSION",
70 'Template name: ' . $self -> param('tmpl_name'),
71 'Template path: ' . $self -> param('tmpl_path'),
72 );
73  
74 $template -> param(li_loop => [map{ {item => $_} } @content]);
75 $template -> param(title => __PACKAGE__);
76  
77 return $template -> output;
78  
79 } # End of start.
80  
81 # -----------------------------------------------
82  
83 1;