Help for this page

Select Code to Download


  1. or download this
    sub process_data {
        if ($debug) {
    ...
        $sth->finish;
        $dbh->disconnect;
    }
    
  2. or download this
    sub process_data {
        if ($debug) {
    ...
        $sth->finish;
        $dbh->disconnect;
    }
    
  3. or download this
    # Up above your main loop
    my $DBH;
    ...
                      $json->{'lux'}, $json->{'bbl'},  $json->{'irl'}, $js
    +on->{'ra'}, $json->{'rr'}
        );
    }
    
  4. or download this
        my $q = "insert into weather_data("
              . "    reading_DTM, reading_YMD, reading_HMS, wd,"
    ...
              . "    ?,           ?,           ?,           ?,"
              . "    ?,           ?,           ?,           ?"
              . ")";
    
  5. or download this
    sub process_data {
        my $rData = shift;        # Fetch the reference to the $json data 
    ...
    
        . . . the rest of the subroutine . . .
    }
    
  6. 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
                              };
    
  7. or download this
    sub process_data {
        if ($debug) {
    ...
                      $JSON{'bbl'},    $JSON{'irl'}, $JSON{'ra'}, $JSON{'r
    +r'}
        );
    }
    
  8. 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'}
        );
    
  9. 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'
                           }
        );