line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Petal::Utils::Or; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
20
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
127
|
|
4
|
4
|
|
|
4
|
|
19
|
use warnings::register; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
426
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
20
|
use Carp; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
219
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
19
|
use base qw( Petal::Utils::Base ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
311
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
19
|
use constant name => 'or'; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
190
|
|
11
|
4
|
|
|
4
|
|
17
|
use constant aliases => qw(); |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
871
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1]; |
14
|
|
|
|
|
|
|
our $REVISION = (split(/ /, ' $Revision: 1.2 $ '))[2]; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub process { |
17
|
1
|
|
|
1
|
0
|
28737
|
my $class = shift; |
18
|
1
|
|
|
|
|
5
|
my $hash = shift; |
19
|
1
|
|
33
|
|
|
8
|
my $args = shift || confess( "'or' expects 2 variables (got nothing)!" ); |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
14
|
my @args = $class->split_first_arg( $args ); |
22
|
1
|
|
33
|
|
|
6
|
my $arg1 = $args[0] || confess( "1st arg to 'or' should be a variable (got nothing)!" ); |
23
|
1
|
|
33
|
|
|
5
|
my $arg2 = $args[1] || confess( "2nd arg to 'or' should be a variable (got nothing)!" ); |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
8
|
my $h1 = $hash->fetch($arg1); |
26
|
1
|
|
|
|
|
69
|
my $h2 = $hash->fetch($arg2); |
27
|
|
|
|
|
|
|
|
28
|
1
|
50
|
33
|
|
|
68
|
return ($h1 || $h2) ? 1 : 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |