Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach $ciudad(@ciudades){
- $gw->city("$ciudad", {language => 'es', encoding => 'utf-8'});
- my $current = $gw->current;
- @info = ($current->{temp_c});
- $temperatura = $info[0];
- $sth = $dbh->prepare("INSERT INTO temp_ciudad (city, temperatura) VALUES ('$ciudad', $temperatura)");
- if(!defined$sth){
- die "Cannot prepare statement: $DBI::errstr\n";
- }
- else{
- $sth->execute();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement