line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Orze::Sources::Include; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1230
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
97
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base "Orze::Sources"; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
262
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Orze::Sources::Include - Simply load a file and make its content |
11
|
|
|
|
|
|
|
available in a variable |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Use the C attribute to give the filename. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 METHOD |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head2 evaluate |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub evaluate { |
24
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $page = $self->{page}; |
27
|
0
|
|
|
|
|
|
my $var = $self->{var}; |
28
|
0
|
|
|
|
|
|
my $file = $self->file(); |
29
|
|
|
|
|
|
|
|
30
|
0
|
0
|
|
|
|
|
if (-r $file) { |
31
|
0
|
|
|
|
|
|
open my $handle, "<", $file; |
32
|
0
|
|
|
|
|
|
my @lines = <$handle>; |
33
|
0
|
|
|
|
|
|
close $handle; |
34
|
0
|
|
|
|
|
|
my $value = join('', @lines); |
35
|
0
|
|
|
|
|
|
return $value; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
else { |
38
|
0
|
|
|
|
|
|
$self->warning("unable to read file " . $file); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |