line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VS::RuleEngine::Util; |
2
|
|
|
|
|
|
|
|
3
|
32
|
|
|
32
|
|
169
|
use strict; |
|
32
|
|
|
|
|
61
|
|
|
32
|
|
|
|
|
5630
|
|
4
|
32
|
|
|
32
|
|
515
|
use warnings; |
|
32
|
|
|
|
|
50
|
|
|
32
|
|
|
|
|
927
|
|
5
|
|
|
|
|
|
|
|
6
|
32
|
|
|
32
|
|
155
|
use Carp qw(croak); |
|
32
|
|
|
|
|
56
|
|
|
32
|
|
|
|
|
10343
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(); |
13
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
14
|
|
|
|
|
|
|
is_existing_package |
15
|
|
|
|
|
|
|
is_valid_name |
16
|
|
|
|
|
|
|
is_valid_package_name |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = (); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub is_valid_name { |
22
|
255
|
|
|
255
|
1
|
477
|
my $name = pop; |
23
|
|
|
|
|
|
|
|
24
|
255
|
|
|
|
|
1639
|
return $name =~ m/^ [A-Za-z] [A-Za-z0-9_]* $/x; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub is_valid_package_name { |
28
|
230
|
|
|
230
|
1
|
344
|
my $pkg = pop; |
29
|
|
|
|
|
|
|
|
30
|
230
|
|
|
|
|
1639
|
return $pkg =~ m/[[:alpha:]_] \w* (?: (?: :: | ') \w+ )*/x; # |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub is_existing_package { |
34
|
256
|
|
|
256
|
1
|
355
|
my $package = pop; |
35
|
32
|
|
|
32
|
|
181
|
no strict 'refs'; |
|
32
|
|
|
|
|
56
|
|
|
32
|
|
|
|
|
2771
|
|
36
|
256
|
100
|
|
|
|
271
|
my $exists = defined *{$package . '::'} ? 1 : 0; |
|
256
|
|
|
|
|
1806
|
|
37
|
256
|
|
|
|
|
876
|
return $exists; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
__END__ |