lib/App/SeismicUnixGui/developer/code/sunix/sunix_package_pod_header.pm untested

filter: Statementstmt 0.0% 0 / 37 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 56 CC 4 SCAR 16.1
CC
4
Cov
0%
set_prog_docs_aref
6.0
set_header
6.0
get_section
6.0
CRAP 5.0
1 package App::SeismicUnixGui::developer::code::sunix::sunix_package_pod_header;
2 use Moose;
3 our $VERSION = '0.0.1';
4  
5 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
6  
7 my $get = L_SU_global_constants->new();
8  
9 my $var = $get->var();
10 my $empty_string = $var->{_empty_string};
11  
12 =pod
13  
14 private hash
15  
16 =cut
17  
18 my $sunix_package_pod_header = {
19  
20 _prog_docs => '',
21  
22 };
23  
24 sub set_prog_docs_aref {
25  
26 my ( $self, $prog_docs_aref ) = @_;
27  
28 if ( defined $prog_docs_aref
29 && $prog_docs_aref ne $empty_string )
30 {
31 my @prog_docs = @$prog_docs_aref;
32 my $length = scalar @prog_docs;
33  
34 $sunix_package_pod_header->{_prog_docs} = \@$prog_docs_aref;
35  
36 # print("sunix_package_pod_header,set_prog_docs, @$prog_docs_aref\n");
37  
38 }
39 else {
40 print("sunix_package_pod_header,set_prog_docs, missing prog_docs\n");
41 }
42  
43 }
44  
45 =head2 Default perl lines for the pod_headers of the file
46  
47  
48 =cut
49  
50 sub set_header {
51  
52 my ($self) = @_;
53  
54 my @head;
55  
56 $head[0] =
57  
58 '=head2 SYNOPSIS
59  
60 PERL PROGRAM NAME:
61  
62 AUTHOR:
63  
64 DATE:
65  
66 DESCRIPTION:
67  
68 Version:
69  
70 =head2 USE
71  
72 =head3 NOTES
73  
74 =head4 Examples
75  
76 =head2 SYNOPSIS
77  
78 =head3 SEISMIC UNIX NOTES'. "\n";
79  
80 if ( $sunix_package_pod_header->{_prog_docs} ) {
81  
82 # add a NEW LINE character to each element of the array
83 my $prog_docs_aref = $sunix_package_pod_header->{_prog_docs};
84 my @prog_docs = @$prog_docs_aref;
85 my $length = scalar @prog_docs;
86 my $last_line = $length + 1;
87  
88 for ( my $i = 0; $i < $length; $i++) {
89  
90 # print("set_header\n");
91  
92 $head[0] = $head[0] . $prog_docs[$i] . "\n\n";
93  
94 # print("sunix_package_pod_header,prog_docs,line#$i : $head[0]");
95 }
96  
97 # print("sunix_package_pod_header,prog_docs,line#0 : $head[0]");
98 $head[0] = $head[0] .
99
100 '=head2 User\'s notes (Juan Lorenzo)
101 untested
102  
103 =cut
104  
105  
106 =head2 CHANGES and their DATES
107  
108 =cut' . "\n\n";
109  
110 $sunix_package_pod_header->{_header} = \@head;
111 # print("sunix_package_pod_header,get_section,result: @head");
112  
113 }
114 else {
115 print("sunix_package_pod_header,set_header,missing paramters");
116 }
117  
118 }
119  
120 sub get_section {
121  
122 if ( $sunix_package_pod_header->{_header} ) {
123  
124 my $result = $sunix_package_pod_header->{_header};
125 # print("sunix_package_pod_header,get_section,result: @$result\n");
126 return ($result);
127  
128 }
129 else {
130 print("sunix_package_pod_header,get_section, missing header\n");
131 }
132  
133 }
134  
135 1;