- or download this
sub process_data {
if ($debug) {
...
$sth->finish;
$dbh->disconnect;
}
- or download this
sub process_data {
if ($debug) {
...
$sth->finish;
$dbh->disconnect;
}
- or download this
# Up above your main loop
my $DBH;
...
$json->{'lux'}, $json->{'bbl'}, $json->{'irl'}, $js
+on->{'ra'}, $json->{'rr'}
);
}
- or download this
my $q = "insert into weather_data("
. " reading_DTM, reading_YMD, reading_HMS, wd,"
...
. " ?, ?, ?, ?,"
. " ?, ?, ?, ?"
. ")";
- or download this
sub process_data {
my $rData = shift; # Fetch the reference to the $json data
...
. . . the rest of the subroutine . . .
}
- or download this
my $json = # create a new scalar
{ # and we'll make it a new hash reference
+ containing:
% # the list of key/value elements in the
+hash
$data # in the $data hash reference
};
- or download this
sub process_data {
if ($debug) {
...
$JSON{'bbl'}, $JSON{'irl'}, $JSON{'ra'}, $JSON{'r
+r'}
);
}
- or download this
$STH->execute($dt->datetime(), $dt->ymd(), $dt->hms(), $JSON{'w
+d'},
$JSON{'wv'}, $JSON{'tF'}, $JSON{'tC'}, $JSON{'b
+p'},
$JSON{'rh'}, $JSON{'li'}, $JSON{'ov'}, $JSON{'l
+ux'},
$JSON{'bbl'}, $JSON{'irl'}, $JSON{'ra'}, $JSON{'r
+r'}
);
- or download this
$STH->execute($dt->datetime(), $dt->ymd(), $dt->hms(),
@JSON{ 'wd', 'wv', 'tF', 'tC', 'bp', 'rh',
'li', 'ov', 'lux', 'bbl', 'irl', 'ra', 'rr'
}
);