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