[問題] 程式運行時發生錯誤

看板Perl作者 (輕踏水無痕)時間7年前 (2017/08/08 11:47), 7年前編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
因為工作上的需要接觸了一些使用Perl寫的生物資訊軟體 但按照指示安裝並運行測試指令後,出現以下錯誤 $ Can't use an undefined value as an ARRAY reference at mlst.pl line 898, <TBL> line 6221. 錯誤訊息的程式碼如下 for (my $i=0; $i < scalar(@$hitArray); $i++){ my $tmpQuerySingleLine = @$queryArray[$i]; my $tmpHomoSingleLine = @$homoArray[$i]; my $tmpHitSingleLine = @$hitArray[$i]; $txtresults .= "MLST allele seq: ".$tmpQuerySingleLine."\n"; $txtresults .= " ".$tmpHomoSingleLine."\n"; $txtresults .= "Hit in genome: ".$tmpHitSingleLine."\n\n"; $allelealign .= $tmpQuerySingleLine."\n"; $hits .= $tmpHitSingleLine."\n"; }#end for 麻煩各位幫忙看一下,謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 117.56.12.50 ※ 文章網址: https://www.ptt.cc/bbs/Perl/M.1502164065.A.2E0.html ※ 編輯: chen1i6c04 (117.56.12.50), 08/08/2017 14:48:29

08/08 15:52, , 1F
所以898行是哪一行?有附測試資料嗎?這樣很難抓吔
08/08 15:52, 1F

08/08 16:11, , 2F
問題已解決,似乎是測試資料有問題,真是不好意思
08/08 16:11, 2F
文章代碼(AID): #1PYJHXBW (Perl)
文章代碼(AID): #1PYJHXBW (Perl)