刚接触这个,老师直接让改程序,语法粗看了下,下面这段还不懂但是时间又很紧,不能慢慢研究了,麻烦前辈们帮忙解答下,感激不尽^_^

sub extract_person_list_from_database()
{
  my ($option, $total, $cid, $port) = @_;
  my $sql_fetch_person = qq {select id, name from contact_info where
issearch = 0 and id % ? = ? limit 20 };
   #where 后面是什么意思啊?
  our $thedbh = &connect_database();
  my $stat = $thedbh->prepare($sql_fetch_person);
  my $sql_set_search = qq {update contact_info set issearch=1 where
id=?};  #update是什么意思
  my $stat_set_search = $thedbh->prepare($sql_set_search);
  my @current_array;
  my $flag = 1;
  my $rv;
  my ($id, $name);   #这几行都是声明吗? ($id, $name);   为什么加括号
  while ( $flag == 1 )
  {
     $rv = $stat->execute($total, $cid);
     @current_array = ();
     if( $rv > 0 )
     {
      $stat->bind_columns(\$id, \$name);   #这里也不知道?
      while ( $stat->fetch())
      {
        push(@current_array, $id);
        if( $option eq "ie")
        {
          &extract_person_with_IEGoogle($name, $id, $port);
        }
        else
        {
          &extract_person($name, $id);
        }
      }
     }
     else
     {
      $flag = 0;
     }

     foreach my $caid (@current_array)
     {
      $stat_set_search->execute($caid);
     }
  }
  &disconnect_database($thedbh);
}

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。
 要在此论坛发帖,请发电子邮件到 [email protected]
 要退订此论坛,请发邮件至 [email protected]
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复