blob: b67c040e3d7632b611d97b5322b37d83bb2a7634 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# vim:ts=8:sw=8
use strict;
use warnings;
use utf8;
use DBI;
use Data::Dumper;
use JSON;
use nms;
package nms::dbconfig;
use base 'Exporter';
our @EXPORT = qw(%config);
our %config;
my $dbh;
use Data::Dumper;
BEGIN {
$dbh = nms::db_connect();
my $q2 = $dbh->prepare('select * from config order by id desc limit 1;');
$q2->execute();
while (my $ref = $q2->fetchrow_hashref()) {
%config = %$ref;
$config{'data'} = JSON::XS::decode_json($ref->{'data'});
}
$dbh->disconnect();
}
1;
|