line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Anego::Util; |
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
4
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
19
|
use parent qw/ Exporter /; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
41
|
use Anego::Logger; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
8
|
1
|
|
|
1
|
|
6
|
use Anego::Config; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
138
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw/ do_sql /; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub do_sql { |
13
|
0
|
|
|
0
|
0
|
|
my ($sql) = @_; |
14
|
0
|
|
|
|
|
|
my $config = Anego::Config->load; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my @statements = map { "$_;" } grep { /\S+/ } split /;/, $sql; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
for my $statement (@statements) { |
18
|
0
|
0
|
|
|
|
|
$config->dbh->do($statement) or errorf($config->dbh->errstr) |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |