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
Say what perl -c returns #21686
Say what perl -c returns #21686
Conversation
The page forgets to say what -c returns. So I added my guess. Please improve it.
I don't have any technical details on what this does, but I do think it would be useful information to have in the docs. |
Yeah that totally doesn't actually return -1, I don't think any platform supports that. It returns a non-zero value (typically |
All I know is it is non-zero. |
It depends on what you expect:
I think all you can really say is "non-zero". |
What would you use the exit code for in practice? I can't even think of a useful corner case in a CI context ... It's always going to be |
One would like to double check that all the Perl programs one is about to upload, are all grammatically correct, but one doesn't want to actually run the programs (that do big things.) That's an example of one of the many uses of the return value. |
Exactly, you only care if the exit code is zero. You don't care which kind of non-valid perl program you have. If you want to fix your script, you read the diagnostics perl prints just before exiting. So to expand on my question: what would a hypothetical calling script do differently if the code you're It just seems unreasonable to enumerate every single way a text file can be a non-valid perl program, especially when unix exit codes are finite. |
Yes. Just mention "Exit value: Returns 0 for success (no syntax errors) and various non-zero values if there were errors." That way a person reading the man page will know s/he can count on using perl -c to check for syntax errors, unattended. I mean even
has an Exit status section. |
The page forgets to say what -c returns. So I added my guess. Please improve it.