line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Firstofdefined; |
2
|
2
|
|
|
2
|
|
734
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
3
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
39
|
|
4
|
2
|
|
|
2
|
|
45
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
5
|
2
|
|
|
2
|
|
11
|
use parent 'DTL::Fast::Tag::Firstof'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
12
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{firstofdefined} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# conditional rendering |
10
|
|
|
|
|
|
|
sub render |
11
|
|
|
|
|
|
|
{ |
12
|
12
|
|
|
12
|
0
|
24
|
my ( $self, $context, $global_safe) = @_; |
13
|
12
|
|
|
|
|
15
|
my $result = ''; |
14
|
|
|
|
|
|
|
|
15
|
12
|
|
|
|
|
21
|
foreach my $source (@{$self->{sources}}) |
|
12
|
|
|
|
|
19
|
|
16
|
|
|
|
|
|
|
{ |
17
|
27
|
100
|
|
|
|
69
|
if (defined ($result = $source->render($context, $global_safe))) |
18
|
|
|
|
|
|
|
{ |
19
|
12
|
|
|
|
|
23
|
last; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
12
|
|
|
|
|
45
|
return $result; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |