Created
May 23, 2016 22:32
Star
You must be signed in to star a gist
Suggestion for adding :ww documentation to qw and qqw docs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Under qw (extension of existing paragraph): | |
| The C<:w> form, usually written C«<…>» or C<qw>, splits the string into | |
| "words". In this context, words are defined as sequences of non-whitespace | |
| characters separated by whitespace. The C<q:w> and C<qw> forms inherit the | |
| interpolation and escape semantics of the C<q> and single quote string | |
| delimiters, whereas C<Qw> and C<Q:w> inherit the non-escaping semantics of | |
| the C<Q> quoter. Note that C<:w> will preserve any quote characters in the text. I. e. | |
| C<qw/'hello world'/> will return "'hello" and "world'". If you want the quotes | |
| removed, use the C:ww> adverb: C<qww>. | |
| Under qqw (at end of qqw documentation): | |
| As noted under C<qw>, C<:w> will preserve any quote characters, while C<:ww> will | |
| discard them. So, you would use C<qqw> and C<qqww> accordingly. |
If you want the quotes removed, use the C:ww> adverb: C.
Makes it sound like :ww is some sort of quote remover. That's not the point. The point is that under :ww, hello world is a single element, while with :w it is two elements: 'hello and world'.
WRT "string delimiters", that's in the existing documentation, so... I dunno.
And, yes I did miss that point about :ww. Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
String delimiters?