c**y 发帖数: 2282 | 1 在执行这句的时候:
$sth->execute($file,$comments);
如果由于数据库方面的原因出错,(例如主键重复),perl方面将给出一个出错信息并
退出。但是我不想让perl退出啊,该怎么办? | t****t 发帖数: 6806 | 2 eval { no warnings 'all'; $sth->execute(...) };
if ($@) {
# process the error
}
【在 c**y 的大作中提到】 : 在执行这句的时候: : $sth->execute($file,$comments); : 如果由于数据库方面的原因出错,(例如主键重复),perl方面将给出一个出错信息并 : 退出。但是我不想让perl退出啊,该怎么办?
|
|