关于perl的问题,百思不得其解。请教高手,谢谢(附代码)
subinitial_cc{my$self=shift;my$dbh=Bugzilla->dbh;if(!defined$self->{'initial_cc'}){#I...
sub initial_cc {
my $self = shift;
my $dbh = Bugzilla->dbh;
if (!defined $self->{'initial_cc'}) {
# If set_cc_list() has been called but data are not yet written
# into the DB, we want the new values defined by it.
my $cc_ids = $self->{cc_ids}
|| $dbh->selectcol_arrayref('SELECT user_id FROM component_cc
WHERE component_id = ?',
undef, $self->id);
$self->{'initial_cc'} = Bugzilla::User->new_from_list($cc_ids);
}
return $self->{'initial_cc'};
}
请问这子函数实现的功能是什么?本人小白,求详细说明,再辞感谢 展开
my $self = shift;
my $dbh = Bugzilla->dbh;
if (!defined $self->{'initial_cc'}) {
# If set_cc_list() has been called but data are not yet written
# into the DB, we want the new values defined by it.
my $cc_ids = $self->{cc_ids}
|| $dbh->selectcol_arrayref('SELECT user_id FROM component_cc
WHERE component_id = ?',
undef, $self->id);
$self->{'initial_cc'} = Bugzilla::User->new_from_list($cc_ids);
}
return $self->{'initial_cc'};
}
请问这子函数实现的功能是什么?本人小白,求详细说明,再辞感谢 展开
展开全部
只看懂一个大概。
cc就是bugzilla中提交bug或者回复bug时的那个抄送啊,所以叫初始化cc咯。
my $cc_ids = $self->{cc_ids}
|| $dbh->selectcol_arrayref('SELECT user_id FROM component_cc
WHERE component_id = ?',
undef, $self->id);
判断这个$self->{cc_ids}是否存在,不存在就执行对数据库的操作。
cc就是bugzilla中提交bug或者回复bug时的那个抄送啊,所以叫初始化cc咯。
my $cc_ids = $self->{cc_ids}
|| $dbh->selectcol_arrayref('SELECT user_id FROM component_cc
WHERE component_id = ?',
undef, $self->id);
判断这个$self->{cc_ids}是否存在,不存在就执行对数据库的操作。
追问
嗯,谢谢,另外可以加一下您的QQ吗?我正在修改bugzilla,想寻求您的帮助。
追答
可以,你加啊,就是我的帐号后面是我Q啊。我也不怎么懂的。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询