Skip to content

Instantly share code, notes, and snippets.

@dha
Created May 23, 2016 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dha/409794ce0679da81507eaf2602d39374 to your computer and use it in GitHub Desktop.
Save dha/409794ce0679da81507eaf2602d39374 to your computer and use it in GitHub Desktop.
Suggestion for adding :ww documentation to qw and qqw docs.
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.
@AlexDaniel
Copy link

single quote string delimiters

String delimiters?

@AlexDaniel
Copy link

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'.

@dha
Copy link
Author

dha commented May 25, 2016

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