2
我正在使用XML :: DOM處理Perl代碼。perl中的返回值XML :: DOM
我在Perl的幫助(XML :: DOM :: Node)中發現,聲明如下。
@list = $node->getChildNodes; # returns a perl list
$nodelist = $node->getChildNodes; # returns a NodeList (object reference)
for my $kid ($node->getChildNodes) # iterate over the children of $node
如果我通過它在我的函數如下。
&myfunction($node->getChildNodes)
我沒有得到列表的參考。
有沒有什麼辦法可以用out來聲明臨時標量變量,如下所示。
my $tmp=$node->getChildNodes;
&myfunction($tmp)
謝謝。
它的作品!謝謝。 – NewToUnix
如果這回答你的問題,請檢查它旁邊的標記。歡迎來到StackOverflow! – ikegami