CSAILVision / CSAILVision/LabelMeAnnotationTool

fetch_image.cgi: Can't return outside a subroutine ...

オープン
#110 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.5k
フォーク
443
PR マージ指標
30日以内にマージされた PR はありません

説明

I am looking at the code in `https://github.com/CSAILVision/LabelMeAnnotationTool/blob/master/annotationTools/perl/fetch_image.cgi` and keep seeing `return` statement being used outside of a function, like this

```
if(!open(FP,$fname)) {
print "Status: 404\n\n";
return; # <--- this one o_O
}
```

it repeats over an over again, e.g. at lines 24, 49, 74, etc

Perl would throw an error in such cases `Can't return outside a subroutine ...`. Which is expected, because `return` is used to return from a subroutine and there are no subroutines defined in the whole script. Indeed, you will see the error message appear in apache error log if you try with a faked URL (note `collection=empty` that corresponds to no file)

```
tool.html?mode=c&collection=empty
```

What am I missing? Is it just a joke?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Open annotationTools/perl/fetch_image.cgi and inspect the repeated return statements around lines 24, 49, and 74. Reproduce the request using tool.html?mode=c&collection=empty and check the Apache error log; done means explaining or resolving the reported outside-a-subroutine error.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
perl
領域
backend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。