line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SQLayer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$SQLayer::VERSION = '1.1'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
656
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
94
|
|
7
|
1
|
|
|
1
|
|
2244
|
use DBI; |
|
1
|
|
|
|
|
23850
|
|
|
1
|
|
|
|
|
2236
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
|
|
|
|
|
|
{ |
11
|
0
|
|
|
0
|
0
|
|
my ($class, %HKeys) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my $self = {DEBUG => '', |
14
|
|
|
|
|
|
|
errstr => ''}; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
bless $self, $class; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$self -> _init(%HKeys); |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
return $self |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub DESTROY |
24
|
|
|
|
|
|
|
{ |
25
|
0
|
|
|
0
|
|
|
shift -> {dbh} -> disconnect; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub errstr |
29
|
|
|
|
|
|
|
{ |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
0
|
0
|
|
return shift -> {errstr} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub DEBUG |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
37
|
0
|
|
|
|
|
|
my $level = shift; |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
return $self -> {DEBUG} unless $level; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
$self -> {DEBUG} = 1 if $level == 1; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
DBI -> trace($level - 1) unless $level == 1; |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return 1 |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub transaction |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
51
|
0
|
0
|
|
|
|
|
if ($self -> {'TRANSACTION'} ne 'YES') |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
$self -> enable_transactions(); |
54
|
0
|
|
|
|
|
|
$self -> proc("BEGIN"); |
55
|
0
|
|
|
|
|
|
$self -> {'TRANSACTION'} = 'YES'; |
56
|
0
|
|
|
|
|
|
} else { warn "SQLayer: Transaction already in progress!" } |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub commit |
61
|
|
|
|
|
|
|
{ |
62
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
63
|
0
|
0
|
|
|
|
|
if ($self -> {'TRANSACTION'} eq 'YES') |
64
|
|
|
|
|
|
|
{ |
65
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
66
|
0
|
|
|
|
|
|
$dbh -> commit(); |
67
|
0
|
|
|
|
|
|
$self -> disable_transactions(); |
68
|
0
|
|
|
|
|
|
$self -> {'TRANSACTION'} = 'NO'; |
69
|
0
|
|
|
|
|
|
} else { warn "SQLayer: No transaction in progress or method 'begin' never called. Please use methob 'begin' to handle transactions!" } |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub rollback |
74
|
|
|
|
|
|
|
{ |
75
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
76
|
0
|
0
|
|
|
|
|
if ($self -> {'TRANSACTION'} eq 'YES') |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
79
|
0
|
|
|
|
|
|
$dbh -> rollback(); |
80
|
0
|
|
|
|
|
|
$self -> disable_transactions(); |
81
|
0
|
|
|
|
|
|
$self -> {'TRANSACTION'} = 'NO'; |
82
|
0
|
|
|
|
|
|
} else { warn "SQLayer: No transaction in progress or method 'begin' never called. Please use methob 'begin' to handle transactions!" } |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub enable_transactions |
86
|
|
|
|
|
|
|
{ |
87
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
90
|
|
|
|
|
|
|
|
91
|
0
|
|
|
|
|
|
$dbh->{'AutoCommit'} = 0; # enable transactions, if possible |
92
|
0
|
|
|
|
|
|
$dbh->{'RaiseError'} = 1 |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub disable_transactions |
96
|
|
|
|
|
|
|
{ |
97
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
$dbh->{'AutoCommit'} = 1; # enable transactions, if possible |
102
|
0
|
|
|
|
|
|
$dbh->{'RaiseError'} = 1 |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
sub connect_status |
105
|
|
|
|
|
|
|
{ |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
0
|
0
|
|
return shift -> {connect_status} |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub nodebug |
111
|
|
|
|
|
|
|
{ |
112
|
0
|
|
|
0
|
0
|
|
shift -> {DEBUG} = '' |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub row |
116
|
|
|
|
|
|
|
{ |
117
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
118
|
0
|
|
|
|
|
|
my $query = shift; |
119
|
|
|
|
|
|
|
|
120
|
0
|
0
|
|
|
|
|
warn $query if $self -> DEBUG; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
my $sth; |
123
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
eval |
126
|
0
|
|
|
|
|
|
{ |
127
|
|
|
|
|
|
|
$sth = $dbh -> prepare($query) || do |
128
|
0
|
|
0
|
|
|
|
{ |
129
|
|
|
|
|
|
|
warn $dbh -> errstr, " $query\n"; |
130
|
|
|
|
|
|
|
$self -> {errstr} .= $dbh->errstr; |
131
|
|
|
|
|
|
|
return undef; |
132
|
|
|
|
|
|
|
}; |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
eval |
136
|
0
|
|
|
|
|
|
{ |
137
|
|
|
|
|
|
|
$sth -> execute || do |
138
|
0
|
0
|
|
|
|
|
{ |
139
|
0
|
|
|
|
|
|
warn $dbh -> errstr, " $query\n"; |
140
|
0
|
|
|
|
|
|
$self -> {errstr} .= $dbh -> errstr; |
141
|
0
|
|
|
|
|
|
return undef; |
142
|
|
|
|
|
|
|
}; |
143
|
|
|
|
|
|
|
}; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
my @row = $sth -> fetchrow_array; |
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
$sth -> finish; |
148
|
|
|
|
|
|
|
|
149
|
0
|
0
|
|
|
|
|
return wantarray ? @row : $row[0]; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
sub proc |
153
|
|
|
|
|
|
|
{ |
154
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
155
|
0
|
|
|
|
|
|
my $query = shift; |
156
|
|
|
|
|
|
|
|
157
|
0
|
0
|
|
|
|
|
warn $query if $self -> DEBUG; |
158
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
my $res = $self -> {'dbh'} -> do($query); |
160
|
0
|
|
|
|
|
|
$self -> {errstr} .= $self -> {dbh} -> errstr; |
161
|
|
|
|
|
|
|
|
162
|
0
|
0
|
|
|
|
|
return $res if $res; |
163
|
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
return undef; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub all_rows |
168
|
|
|
|
|
|
|
{ |
169
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
170
|
0
|
|
|
|
|
|
my $query = shift; |
171
|
|
|
|
|
|
|
|
172
|
0
|
|
|
|
|
|
my $sth; |
173
|
|
|
|
|
|
|
|
174
|
0
|
0
|
|
|
|
|
warn $query if $self -> DEBUG; |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
my $dbh = $self -> {'dbh'}; |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
eval |
179
|
0
|
|
|
|
|
|
{ |
180
|
|
|
|
|
|
|
$sth = $dbh -> prepare($query) || do |
181
|
0
|
|
0
|
|
|
|
{ |
182
|
|
|
|
|
|
|
warn $dbh -> errstr, " $query\n"; |
183
|
|
|
|
|
|
|
$self -> {errstr} .= $dbh -> errstr; |
184
|
|
|
|
|
|
|
return undef; |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
}; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
eval |
189
|
0
|
|
|
|
|
|
{ |
190
|
|
|
|
|
|
|
$sth -> execute || do |
191
|
0
|
0
|
|
|
|
|
{ |
192
|
0
|
|
|
|
|
|
warn $dbh -> errstr, " $query\n"; |
193
|
0
|
|
|
|
|
|
$self -> {errstr} .= $dbh -> errstr; |
194
|
0
|
|
|
|
|
|
return undef; |
195
|
|
|
|
|
|
|
} |
196
|
|
|
|
|
|
|
}; |
197
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
|
my $ret = $sth -> fetchall_arrayref; |
199
|
0
|
|
|
|
|
|
$sth -> finish; |
200
|
|
|
|
|
|
|
|
201
|
0
|
|
|
|
|
|
return $ret; |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub row_hash |
205
|
|
|
|
|
|
|
{ |
206
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
207
|
0
|
|
|
|
|
|
my $query = shift; |
208
|
|
|
|
|
|
|
|
209
|
0
|
|
|
|
|
|
my $sth; |
210
|
|
|
|
|
|
|
|
211
|
0
|
0
|
|
|
|
|
warn $query if $self->DEBUG; |
212
|
|
|
|
|
|
|
|
213
|
0
|
|
|
|
|
|
my $dbh = $self->{'dbh'}; |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
eval |
216
|
0
|
|
|
|
|
|
{ |
217
|
|
|
|
|
|
|
$sth = $dbh->prepare($query) || do |
218
|
0
|
|
0
|
|
|
|
{ |
219
|
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
220
|
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
221
|
|
|
|
|
|
|
return undef; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
}; |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
eval |
226
|
0
|
|
|
|
|
|
{ |
227
|
|
|
|
|
|
|
$sth->execute || do |
228
|
0
|
0
|
|
|
|
|
{ |
229
|
0
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
230
|
0
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
231
|
0
|
|
|
|
|
|
return undef; |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
}; |
234
|
|
|
|
|
|
|
|
235
|
0
|
|
|
|
|
|
my $ret = $sth->fetchall_arrayref({}); |
236
|
|
|
|
|
|
|
|
237
|
0
|
|
|
|
|
|
$sth -> finish; |
238
|
|
|
|
|
|
|
|
239
|
0
|
|
|
|
|
|
return $ret; |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub column |
243
|
|
|
|
|
|
|
{ |
244
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
245
|
0
|
|
|
|
|
|
my $query = shift; |
246
|
|
|
|
|
|
|
|
247
|
0
|
|
|
|
|
|
my $ret; |
248
|
|
|
|
|
|
|
|
249
|
0
|
0
|
|
|
|
|
warn $query if $self -> DEBUG; |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
eval |
252
|
0
|
|
|
|
|
|
{ |
253
|
0
|
|
|
|
|
|
$ret = $self -> {dbh} -> selectcol_arrayref($query); |
254
|
|
|
|
|
|
|
}; |
255
|
|
|
|
|
|
|
|
256
|
0
|
0
|
|
|
|
|
if ($@) |
257
|
|
|
|
|
|
|
{ |
258
|
0
|
|
|
|
|
|
warn $@; |
259
|
0
|
|
|
|
|
|
$self -> {errstr} .= $self -> {dbh} -> errstr; |
260
|
0
|
|
|
|
|
|
return undef; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
0
|
|
|
|
|
|
return @$ret; |
264
|
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
sub hash_all |
267
|
|
|
|
|
|
|
{ |
268
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
269
|
0
|
|
|
|
|
|
my $query = shift; |
270
|
|
|
|
|
|
|
|
271
|
0
|
0
|
|
|
|
|
warn $query if $self->DEBUG; |
272
|
|
|
|
|
|
|
|
273
|
0
|
|
|
|
|
|
my %ret; |
274
|
|
|
|
|
|
|
my $sth; |
275
|
0
|
|
|
|
|
|
my $dbh = $self->{dbh}; |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
eval |
278
|
0
|
|
|
|
|
|
{ |
279
|
|
|
|
|
|
|
$sth = $dbh->prepare($query) || do |
280
|
0
|
|
0
|
|
|
|
{ |
281
|
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
282
|
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
283
|
|
|
|
|
|
|
return undef; |
284
|
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
}; |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
eval |
288
|
0
|
|
|
|
|
|
{ |
289
|
|
|
|
|
|
|
$sth->execute || do |
290
|
0
|
0
|
|
|
|
|
{ |
291
|
0
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
292
|
0
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
293
|
0
|
|
|
|
|
|
return undef; |
294
|
|
|
|
|
|
|
} |
295
|
|
|
|
|
|
|
}; |
296
|
|
|
|
|
|
|
|
297
|
0
|
|
|
|
|
|
my $ret = $sth->fetchall_arrayref; |
298
|
|
|
|
|
|
|
|
299
|
0
|
|
|
|
|
|
foreach (@$ret) |
300
|
|
|
|
|
|
|
{ |
301
|
0
|
|
|
|
|
|
$ret{$_->[0]} = $_->[1]; |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
0
|
|
|
|
|
|
return %ret; |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
sub hash_row |
308
|
|
|
|
|
|
|
{ |
309
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
310
|
|
|
|
|
|
|
|
311
|
0
|
|
|
|
|
|
my $query = shift; |
312
|
0
|
0
|
|
|
|
|
warn $query if $self->DEBUG; |
313
|
|
|
|
|
|
|
|
314
|
0
|
|
|
|
|
|
my $sth; |
315
|
0
|
|
|
|
|
|
my $dbh = $self->{dbh}; |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
eval |
318
|
0
|
|
|
|
|
|
{ |
319
|
|
|
|
|
|
|
$sth = $dbh->prepare($query) || do |
320
|
0
|
|
0
|
|
|
|
{ |
321
|
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
322
|
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
323
|
|
|
|
|
|
|
return undef; |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
}; |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
eval |
328
|
0
|
|
|
|
|
|
{ |
329
|
|
|
|
|
|
|
$sth->execute || do |
330
|
0
|
0
|
|
|
|
|
{ |
331
|
0
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
332
|
0
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
333
|
0
|
|
|
|
|
|
return undef; |
334
|
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
}; |
336
|
|
|
|
|
|
|
|
337
|
0
|
|
|
|
|
|
my $ret = $sth->fetchrow_hashref; |
338
|
0
|
|
|
|
|
|
$sth->finish; |
339
|
|
|
|
|
|
|
|
340
|
0
|
|
|
|
|
|
return $ret; |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub hash_var |
344
|
|
|
|
|
|
|
{ |
345
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
346
|
|
|
|
|
|
|
|
347
|
0
|
|
|
|
|
|
my $query = shift; |
348
|
0
|
0
|
|
|
|
|
warn $query if $self->DEBUG; |
349
|
|
|
|
|
|
|
|
350
|
0
|
|
|
|
|
|
my $sth; |
351
|
0
|
|
|
|
|
|
my $dbh = $self->{dbh}; |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
eval |
354
|
0
|
|
|
|
|
|
{ |
355
|
|
|
|
|
|
|
$sth = $dbh->prepare($query) || do |
356
|
0
|
|
0
|
|
|
|
{ |
357
|
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
358
|
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
359
|
|
|
|
|
|
|
return undef; |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
}; |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
eval |
364
|
0
|
|
|
|
|
|
{ |
365
|
|
|
|
|
|
|
$sth->execute || do |
366
|
0
|
0
|
|
|
|
|
{ |
367
|
0
|
|
|
|
|
|
warn $dbh->errstr, " $query\n"; |
368
|
0
|
|
|
|
|
|
$self->{errstr} .= $dbh->errstr; |
369
|
0
|
|
|
|
|
|
return undef; |
370
|
|
|
|
|
|
|
} |
371
|
|
|
|
|
|
|
}; |
372
|
|
|
|
|
|
|
|
373
|
0
|
|
|
|
|
|
my $ret = $sth->fetchrow_hashref; |
374
|
0
|
|
|
|
|
|
$sth->finish; |
375
|
|
|
|
|
|
|
|
376
|
0
|
0
|
|
|
|
|
return ($ret) ? %$ret:undef; |
377
|
|
|
|
|
|
|
} |
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
sub quote |
380
|
|
|
|
|
|
|
{ |
381
|
0
|
|
|
0
|
0
|
|
shift -> {dbh} -> quote(@_); |
382
|
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
# Private Methods |
385
|
|
|
|
|
|
|
sub _init |
386
|
|
|
|
|
|
|
{ |
387
|
0
|
|
|
0
|
|
|
my $self = shift; |
388
|
0
|
|
|
|
|
|
my %HKeys = @_; |
389
|
0
|
|
|
|
|
|
my $BStatus = 1; |
390
|
|
|
|
|
|
|
|
391
|
0
|
|
|
|
|
|
$self -> {'database'} = $HKeys{'database'}; |
392
|
0
|
|
|
|
|
|
$self -> {'user'} = $HKeys{'user'}; |
393
|
0
|
|
|
|
|
|
$self -> {'password'} = $HKeys{'password'}; |
394
|
|
|
|
|
|
|
|
395
|
0
|
|
0
|
|
|
|
$self -> {'dbh'} = DBI -> connect_cached($self -> {'database'}, $self -> {'user'}, $self -> {'password'}, {ChopBlanks => '1'}) || { $BStatus = 0 }; |
396
|
0
|
|
|
|
|
|
$self -> {'connect_status'} = $BStatus; |
397
|
|
|
|
|
|
|
} |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
1; |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
__END__; |