Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nkrot opened this issue Jul 14, 2021 · 0 comments
Open

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

nkrot opened this issue Jul 14, 2021 · 0 comments

Comments

@nkrot
Copy link

nkrot commented Jul 14, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant