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

Quoting barewords with the negation operator not supported #109

Open
haukex opened this issue Oct 4, 2020 · 3 comments
Open

Quoting barewords with the negation operator not supported #109

haukex opened this issue Oct 4, 2020 · 3 comments

Comments

@haukex
Copy link

haukex commented Oct 4, 2020

For example, print -foo;, which would normally just print the string -foo, is not supported. If this is on purpose, it should probably be documented.

@xsawyerx
Copy link
Owner

xsawyerx commented Oct 4, 2020

We documented two relevant pieces:

  • Strings can only be defined with quotes, single quotes, and qw for a list of them.
  • Auto-quoting is not supported.

I think it covered the above well. Do you think we should still explicitly mention this case?

@haukex
Copy link
Author

haukex commented Oct 7, 2020

I was a little off in the issue title, -bareword doesn't seem to be called "autoquoting" in the docs, since it's a special behavior of the negation operator, so it doesn't really fit in the standard.pm docs under "Auto-quoting", or under "Q-Like values delimiters". So I do think it would be good if it got a brief mention somewhere.

(An alternative but more radical change would be to reorganize the docs and put "Auto-quoting", "HEREDOCs", and "Q-Like values delimiters" in a new section "Strings". By the way, looking at the sections in the docs, aren't "constructs that the perl interpreter understands but that that Standard Perl does not support" and "limitations that Standard Perl has which the perl interpreter doesn't" kind of the same thing?)

@haukex haukex changed the title Autoquoting with minus sign not supported Quoting barewords with the negation operator not supported Oct 7, 2020
@xsawyerx
Copy link
Owner

I was a little off in the issue title, -bareword doesn't seem to be called "autoquoting" in the docs, since it's a special behavior of the negation operator, so it doesn't really fit in the standard.pm docs under "Auto-quoting", or under "Q-Like values delimiters". So I do think it would be good if it got a brief mention somewhere.

We would be very happy to receive a documentation patch in the form you think is most readable and least confusing.

(An alternative but more radical change would be to reorganize the docs and put "Auto-quoting", "HEREDOCs", and "Q-Like values delimiters" in a new section "Strings".

Not a bad idea. Would you be able to create a PR for this?

By the way, looking at the sections in the docs, aren't "constructs that the perl interpreter understands but that that Standard Perl does not support" and "limitations that Standard Perl has which the perl interpreter doesn't" kind of the same thing?)

They are similar, that is true. Maybe they should also be merged.

The idea was that the former is about things Standard Perl does not understand and the latter is situations in which Standard Perl purposefully prefers to not recoginize. It also refers to what Perl wants to support versus additional lee-way it gives the user.

I agree these differences might not be significant enough to separate to two parts. Documentation patch on this would also be welcomed. :)

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

No branches or pull requests

2 participants