This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 12th, 2010  |  syntax: None  |  size: 0.36 KB  |  views: 110  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. foreach $ciudad(@ciudades){
  2. $gw->city("$ciudad", {language => 'es', encoding => 'utf-8'});
  3. my $current = $gw->current;
  4. @info = ($current->{temp_c});
  5. $temperatura = $info[0];
  6. $sth = $dbh->prepare("INSERT INTO temp_ciudad (city, temperatura) VALUES ('$ciudad', $temperatura)");
  7. if(!defined$sth){
  8. die "Cannot prepare statement: $DBI::errstr\n";
  9. }
  10. else{
  11. $sth->execute();
  12. }
  13. }
clone this paste RAW Paste Data