我看过这篇SO 帖子,并看到了关于
my @array = ('a', 'b', 'c');
my $variable = @array; # 3 size of @array
my ($variable) = @array; # 'a' $array[0]
@array
分配to的第一个元素my ($variable)
。
我对我继承的以下代码有点困惑。具体来说,是
my ($ptBatchRec);
被声明为指针?
如果我去掉括号会发生什么?
my $DBHandle = shift; # The ICS database handle
my $ptBatchStruct = shift; # -> batch structure (hash)
my ($FiscalYear, $AccountType, $BatchType, $PaymentType, %Args) = @_;
my $DBIsLocked = 0; # Database is locked flag
my ($ptBatchRec); # -> batch record
.
.
.
$ptBatchRec = $DBHandle->selectrow_hashref(
"select * from batch " .
"where yr matches ".$DBHandle->quote($FiscalYear)." " .
"and entry_date = " .
$DBHandle->quote($ptBatchStruct->{"entry_date"})." " .
"and acct_type = ".$DBHandle->quote($AccountType)." " .
"and batch_type = ".$DBHandle->quote($BatchType)." " .
"and pymt_code = ".$DBHandle->quote($PaymentType)." " .
"order by batch_num desc");